Skip to main content

Crate fraiseql_error

Crate fraiseql_error 

Source
Expand description

Unified error types for FraiseQL runtime crates.

All runtime crates depend on this crate for error handling.

§Error bridging contract

RuntimeError is the domain-level error enum that aggregates all business-logic errors (auth, webhooks, files, notifications, etc.). It implements [axum::response::IntoResponse] via the http module’s IntoResponse impl, which converts it to an [ErrorResponse] JSON body with the appropriate HTTP status code:

RuntimeError (domain)
    ↓  IntoResponse (via fraiseql-error::http)
ErrorResponse { error, error_description, error_code, error_uri, details, retry_after }
    ↓  Json(response) + StatusCode
HTTP response body (application/json)

§Mapping rules

RuntimeError variantHTTP status
Auth(InsufficientPermissions)403 Forbidden
Auth(*)401 Unauthorized
Webhook(InvalidSignature)401 Unauthorized
RateLimited429 Too Many Requests
ServiceUnavailable503 Service Unavailable
NotFound404 Not Found
Database500 Internal Server Error
Config / Internal500 Internal Server Error

§Security note

All variants that might leak internal details (database messages, config values, provider endpoints) return generic descriptions in the HTTP response body. Raw error details are available only in structured server logs.

Re-exports§

pub use core_error::ErrorContext;
pub use core_error::FraiseQLError;
pub use core_error::Result;
pub use core_error::ValidationFieldError;
pub use graphql_error::GraphQLError;
pub use graphql_error::GraphQLErrorLocation;

Modules§

core_error
Core error types for FraiseQL operations.
graphql_error
Canonical GraphQL protocol error types.

Enums§

AuthError
Domain-level auth errors for HTTP response mapping.
ConfigError
Errors that occur while loading or validating FraiseQL configuration.
FileError
Errors that occur during file upload, validation, storage, or retrieval.
IntegrationError
Errors that occur when communicating with external integration services such as search engines, caches, or message queues.
NotificationError
Errors that occur during notification delivery (email, SMS, push, etc.).
ObserverError
Domain-level observer errors for RuntimeError aggregation.
RuntimeError
Unified error type wrapping all domain errors.
WebhookError
Errors that occur while receiving and validating inbound webhook requests.