Reference
Error Codes
QUESTPIE error codes and their meanings.
Client Errors
import { QuestpieClientError } from "questpie/client";
try {
await client.collections.posts.update({ ... });
} catch (error) {
if (error instanceof QuestpieClientError) {
error.status; // HTTP status code
error.code; // Error code string
error.message; // Human-readable message
error.fieldErrors; // Field-level validation errors
}
}HTTP Status Codes
| Code | Meaning |
|---|---|
400 | Bad Request — validation failed |
401 | Unauthorized — not authenticated |
403 | Forbidden — insufficient permissions |
404 | Not Found — record doesn't exist |
409 | Conflict — duplicate key or version conflict |
422 | Unprocessable — semantic validation error |
500 | Internal Server Error |
Error Codes
| Code | Description |
|---|---|
VALIDATION_ERROR | Input failed Zod validation |
NOT_FOUND | Record not found |
FORBIDDEN | Access denied by access rules |
UNAUTHORIZED | No valid session |
CONFLICT | Unique constraint or version conflict |
INTERNAL_ERROR | Unexpected server error |
Field Errors
if (error instanceof QuestpieClientError) {
const titleError = error.getFieldError("title");
// "Title is required"
const allErrors = error.getFieldErrorsMap();
// { title: "Title is required", email: "Invalid email" }
}