FramalabError on non-2xx responses.
FramalabError
Basic pattern
error-handling.ts
Error codes
| HTTP | Code | Meaning |
|---|---|---|
| 401 | UNAUTHORIZED | Token missing, invalid, revoked, or expired |
| 404 | NOT_FOUND | Project or collection doesn’t exist |
| 422 | VALIDATION_ERROR | Invalid parameters |
| 500 | INTERNAL_ERROR | Server-side error |
Network errors
Iffetch itself fails (DNS, timeout, offline), the SDK re-throws the native TypeError — not a FramalabError. Handle both:
network.ts
Next.js error boundary
app/gallery/error.tsx