#[non_exhaustive]pub enum FrameworkError {
Unauthenticated,
Forbidden,
Conflict {
message: &'static str,
},
NotFound {
resource: &'static ResourceInfo,
},
PermissionDenied {
permission: &'static PermissionInfo,
},
UnknownOperation,
MethodNotAllowed {
allowed: Vec<&'static str>,
},
UnsupportedMediaType,
InternalFailure,
}Expand description
Errors the framework answers itself, outside any model: a request no operation serves, or an internal failure when the service models no internal error.
Non-exhaustive: the framework may answer new errors, so a match outside
this crate needs a wildcard arm. name,
status and message cover every
variant.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unauthenticated
Credentials were absent or refused by an authentication extension.
Forbidden
An authenticated principal cannot perform the requested action.
Conflict
The request conflicts with one the service already accepted: an idempotency token reused for a different request, or for one still running. The message says which, and what the caller can do.
NotFound
The resource does not exist, or the caller may not know that it
does: the modelled crucible.errors#NotFoundException (404), whose
members are the resource’s fixed message (ResourceInfo::not_found)
and resourceType, its authorization name. An authorization that
hides a resource and a handler reporting genuine absence both answer
it, so the two are indistinguishable. It never names a permission or
an identifier.
Fields
resource: &'static ResourceInfoPermissionDenied
An authenticated caller can see the resource but lacks permission
on it: a 403 ForbiddenException, like Forbidden, whose message is
the permission’s PermissionInfo::denied, naming its value and
resource type, unless the permission is internal: then the message
names neither. Unlike Forbidden it sends no insufficient_scope
challenge: no token would carry a grant.
Fields
permission: &'static PermissionInfoUnknownOperation
MethodNotAllowed
UnsupportedMediaType
InternalFailure
Implementations§
Trait Implementations§
Source§impl Clone for FrameworkError
impl Clone for FrameworkError
Source§impl Debug for FrameworkError
impl Debug for FrameworkError
Source§impl Display for FrameworkError
impl Display for FrameworkError
impl Eq for FrameworkError
Source§impl Error for FrameworkError
impl Error for FrameworkError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()