@spree/docs 0.1.213 → 0.1.215
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.
|
@@ -95,6 +95,8 @@ try {
|
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
+
If a proxy or server returns an empty body, non-JSON content, or JSON without a valid Spree error, the error has code `http_error` and retains the HTTP status. The raw response body is omitted. For requests outside `/auth/`, a `401` still reaches the registered `onUnauthorized` handler. Retry decisions still follow the configured HTTP status policy.
|
|
99
|
+
|
|
98
100
|
### Validation errors
|
|
99
101
|
|
|
100
102
|
On `422` responses, `details` maps attribute names to arrays of messages — ready to project onto form fields:
|
|
@@ -53,6 +53,8 @@ The channel scopes product visibility (only products published on that channel a
|
|
|
53
53
|
|
|
54
54
|
## Error Handling
|
|
55
55
|
|
|
56
|
+
Unsuccessful HTTP responses throw a `SpreeError`. If a proxy or server returns an empty body, non-JSON content, or JSON without a valid Spree error, the error has code `http_error`, retains the HTTP status, and omits the raw response body. Retry decisions still follow the configured HTTP status policy.
|
|
57
|
+
|
|
56
58
|
```typescript
|
|
57
59
|
import { SpreeError } from '@spree/sdk';
|
|
58
60
|
|