Enum telescope::error::TelescopeError [−][src]
pub enum TelescopeError {
Show 19 variants
PageNotFound,
ResourceNotFound {
header: String,
message: String,
},
GatewayError {
header: String,
message: String,
},
RenderingError(RenderError),
FutureCanceled,
InternalServerError(String),
BadRequest {
header: String,
message: String,
show_status_code: bool,
},
NotImplemented,
IpExtractionError,
CsrfTokenNotFound,
CsrfTokenMismatch,
RcosApiError(String),
GitHubApiError(String),
SerenityError(String),
GraphQLError {
platform: String,
errors: Vec<GraphQlError>,
},
InvalidForm(Page),
NotAuthenticated,
Forbidden,
RpiCasError(String),
}
Expand description
All major errors that can occur while responding to a request.
Variants
PageNotFound
404 - Page not found. Use TelescopeError::ResourceNotFound
instead
when possible, as it will have more info.
ResourceNotFound
Fields
header: String
The header of the jumbotron to be displayed.
message: String
The message to display under the jumbotron.
404 - Resource Not Found.
GatewayError
Fields
header: String
The header on the jumbotron to be displayed.
message: String
The message on the jumbotron to be displayed.
Upstream server returned error. This is usually when adding users to the RCOS Discord.
RenderingError(RenderError)
Tuple Fields
0: RenderError
An error in rendering a handlebars template. This will report as an internal server error.
FutureCanceled
An internal future was canceled unexpectedly. This will always report as an internal server error.
InternalServerError(String)
Tuple Fields
0: String
There was an internal server error.
BadRequest
Fields
header: String
The header of the jumbotron to be displayed.
message: String
The error message to be displayed under the jumbotron.
show_status_code: bool
Should the response status code be shown to the user?
The request was malformed.
NotImplemented
Error to send when user accesses something that is not yet implemented.
IpExtractionError
Error saving CSRF Token. This should report as an internal server error
CsrfTokenNotFound
CSRF Token not found. This reports a Not Found status code but should usually be caught before reaching the user (if expected).
CsrfTokenMismatch
The CSRF token provided by the HTTP request did not match the one generated by the server. This should be reported as a bad request.
RcosApiError(String)
Tuple Fields
0: String
Error interacting with RCOS central API. This should generally report as an ISE.
GitHubApiError(String)
Tuple Fields
0: String
Error interacting with GitHub’s GraphQL API. This should generally report as an ISE.
SerenityError(String)
Tuple Fields
0: String
Error interacting with the Discord API via Serenity. This should report as an ISE or a gateway error.
GraphQLError
A GraphQL API responded with errors. This should report as an internal server error.
InvalidForm(Page)
Tuple Fields
0: Page
The user submitted invalid data to a form. This should be reported as a bad request and the form should be displayed for the user to try again. The value here is the page to be displayed to the user.
NotAuthenticated
An unauthenticated user is trying to access a page that requires authentication. Report as unauthorized and direct them to try again.
Forbidden
An authenticated user tried to access a resource that they do not have sufficient permissions to access.
RpiCasError(String)
Tuple Fields
0: String
Error sending to or receiving from the RPI CAS system. This should report as a Gateway error.
Implementations
Create a resource not found error with converted fields.
Construct an Internal Server Error and convert the message.
Convert a reqwest error from the RCOS API into a telescope error.
Convert a reqwest error from the GitHub API into a telescope error.
Convert a Serenity error into a Telescope error.
Convert reqwest error from RPI CAS service into a Telescope error.
Function that should only be used by the middleware to render a telescope error into an error page.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl !RefUnwindSafe for TelescopeError
impl Send for TelescopeError
impl Sync for TelescopeError
impl Unpin for TelescopeError
impl !UnwindSafe for TelescopeError
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more