#[non_exhaustive]pub enum ErrorCode {
Show 16 variants
ValidationError,
ParseError,
RequestError,
Unauthenticated,
Forbidden,
InternalServerError,
DatabaseError,
Timeout,
RateLimitExceeded,
NotFound,
Conflict,
CircuitBreakerOpen,
PersistedQueryNotFound,
PersistedQueryMismatch,
ForbiddenQuery,
DocumentNotFound,
}Expand description
GraphQL error code enumeration.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ValidationError
Validation error.
ParseError
Parse error.
RequestError
Request error.
Unauthenticated
Authentication required.
Forbidden
Access denied.
InternalServerError
Internal server error.
DatabaseError
Database error.
Timeout
Timeout error.
RateLimitExceeded
Rate limit exceeded.
NotFound
Not found.
Conflict
Conflict.
CircuitBreakerOpen
Circuit breaker open — federation entity temporarily unavailable.
PersistedQueryNotFound
Persisted query not found — client must re-send the full query body.
PersistedQueryMismatch
Persisted query hash mismatch — SHA-256 of body does not match provided hash.
ForbiddenQuery
Raw query forbidden — trusted documents strict mode requires a documentId.
DocumentNotFound
Document not found — the provided documentId is not in the trusted manifest.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const fn status_code(self) -> StatusCode
pub const fn status_code(self) -> StatusCode
Get HTTP status code for this error.
Follows the GraphQL over HTTP spec:
a well-formed GraphQL request that fails validation or parsing returns 200 OK
with {"errors": [...]} in the body — never a 4xx — so that standard HTTP clients
can read the error message rather than raising a transport-level exception.
Only RequestError uses 400, because it indicates a truly
malformed HTTP request (missing query field, unreadable JSON body) that was never
a valid GraphQL request to begin with.
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more