@tinycloud/operations 0.3.3-beta.10 → 0.3.3-beta.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2201,16 +2201,17 @@ var KVService = class extends BaseService {
2201
2201
  ...options?.ifNoneMatch === void 0 ? {} : { "if-none-match": options.ifNoneMatch }
2202
2202
  }
2203
2203
  );
2204
+ if (response.status === 401 || response.status === 403) {
2205
+ const errorText = await response.text();
2206
+ const message = errorText.trim().length > 0 ? errorText : `Failed to put key "${key}": ${response.status} - ${response.statusText || "authorization failed"}`;
2207
+ const { resource, action: requiredAction } = parseAuthError(errorText);
2208
+ return err(authUnauthorizedError("kv", message, {
2209
+ status: response.status,
2210
+ ...requiredAction && { requiredAction },
2211
+ ...resource && { resource }
2212
+ }));
2213
+ }
2204
2214
  if (!response.ok) {
2205
- if (response.status === 401) {
2206
- const errorText2 = await response.text();
2207
- const { resource, action } = parseAuthError(errorText2);
2208
- return err(authUnauthorizedError("kv", errorText2, {
2209
- status: response.status,
2210
- ...action && { requiredAction: action },
2211
- ...resource && { resource }
2212
- }));
2213
- }
2214
2215
  const errorText = await response.text();
2215
2216
  if (response.status === 412) {
2216
2217
  return err(serviceError(