@tinycloud/operations 0.3.3-beta.11 → 0.3.3-beta.13

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.
package/dist/index.cjs CHANGED
@@ -3620,16 +3620,17 @@ var init_dist2 = __esm({
3620
3620
  ...options?.ifNoneMatch === void 0 ? {} : { "if-none-match": options.ifNoneMatch }
3621
3621
  }
3622
3622
  );
3623
+ if (response.status === 401 || response.status === 403) {
3624
+ const errorText = await response.text();
3625
+ const message = errorText.trim().length > 0 ? errorText : `Failed to put key "${key}": ${response.status} - ${response.statusText || "authorization failed"}`;
3626
+ const { resource, action: requiredAction } = parseAuthError(errorText);
3627
+ return err(authUnauthorizedError("kv", message, {
3628
+ status: response.status,
3629
+ ...requiredAction && { requiredAction },
3630
+ ...resource && { resource }
3631
+ }));
3632
+ }
3623
3633
  if (!response.ok) {
3624
- if (response.status === 401) {
3625
- const errorText2 = await response.text();
3626
- const { resource, action } = parseAuthError(errorText2);
3627
- return err(authUnauthorizedError("kv", errorText2, {
3628
- status: response.status,
3629
- ...action && { requiredAction: action },
3630
- ...resource && { resource }
3631
- }));
3632
- }
3633
3634
  const errorText = await response.text();
3634
3635
  if (response.status === 412) {
3635
3636
  return err(serviceError(