pub enum WebServerError {
Show 13 variants
Env(EnvError),
Bind {
addr: SocketAddr,
source: Error,
},
SentryDsn(SentryDsnParseError),
Serve(Error),
Template(TemplateError),
TemplatesNotConfigured,
CacheBuster(CacheBusterError),
Sitemap(SitemapError),
Feed(FeedError),
FeedWithoutFrontend,
Observability(ObservabilityError),
PagesRequireTemplates,
DynamicPagePathHasParameters {
path: String,
},
}Expand description
Every way the web server can fail.
Composed from the per-kit errors rather than replacing them: a crate on only
telegram sees TelegramError and never
this type. Deliberately not #[non_exhaustive].
Variants§
Env(EnvError)
A required environment variable was missing or malformed.
Bind
The listener could not bind.
SentryDsn(SentryDsnParseError)
The browser Sentry DSN could not be parsed.
Serve(Error)
The server stopped with an error rather than a shutdown.
Template(TemplateError)
A template could not be loaded or rendered.
TemplatesNotConfigured
A render was attempted without .templates(..) having been called.
CacheBuster(CacheBusterError)
The asset cache could not be built.
Sitemap(SitemapError)
The sitemap could not be written.
Feed(FeedError)
A feed could not be built.
FeedWithoutFrontend
.feed(..) was called on a server that is not a frontend.
A boot failure rather than a shrug: the feed would simply not be served, the autodiscovery links would not be emitted, and nothing at runtime would ever say so.
Observability(ObservabilityError)
Observability could not be configured.
PagesRequireTemplates
Pages were declared without the template data needed to render or list them.
DynamicPagePathHasParameters
A parameterised path was declared as a single page. /blog/{slug}
matches many URLs, so it cannot be one sitemap entry.
Trait Implementations§
Source§impl Debug for WebServerError
Renders the whole error chain, not the enum’s shape.
impl Debug for WebServerError
Renders the whole error chain, not the enum’s shape.
main returning a Result prints its error with Debug, so a derived one
would surface CacheBuster(AmbiguousFavicon) — the variant name — and throw
away the sentence that says what to do about it. Every message in this crate
is written for a human who has just had a boot fail; this is what makes them
visible.
Source§impl Display for WebServerError
impl Display for WebServerError
Source§impl Error for WebServerError
impl Error for WebServerError
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()
Source§impl From<CacheBusterError> for WebServerError
impl From<CacheBusterError> for WebServerError
Source§fn from(source: CacheBusterError) -> Self
fn from(source: CacheBusterError) -> Self
Source§impl From<EnvError> for WebServerError
impl From<EnvError> for WebServerError
Source§impl From<FeedError> for WebServerError
impl From<FeedError> for WebServerError
Source§impl From<ObservabilityError> for WebServerError
impl From<ObservabilityError> for WebServerError
Source§fn from(source: ObservabilityError) -> Self
fn from(source: ObservabilityError) -> Self
Source§impl From<SentryDsnParseError> for WebServerError
impl From<SentryDsnParseError> for WebServerError
Source§fn from(source: SentryDsnParseError) -> Self
fn from(source: SentryDsnParseError) -> Self
Source§impl From<SitemapError> for WebServerError
impl From<SitemapError> for WebServerError
Source§fn from(source: SitemapError) -> Self
fn from(source: SitemapError) -> Self
Source§impl From<TemplateError> for WebServerError
impl From<TemplateError> for WebServerError
Source§fn from(source: TemplateError) -> Self
fn from(source: TemplateError) -> Self
Source§impl IntoResponse for WebServerError
impl IntoResponse for WebServerError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
The body says nothing beyond “internal error”; the detail goes to the log.
Auto Trait Implementations§
impl !RefUnwindSafe for WebServerError
impl !UnwindSafe for WebServerError
impl Freeze for WebServerError
impl Send for WebServerError
impl Sync for WebServerError
impl Unpin for WebServerError
impl UnsafeUnpin for WebServerError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
fn propagate_header(self, header: HeaderName) -> PropagateHeader<Self>where
Self: Sized,
Source§fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
fn add_extension<T>(self, value: T) -> AddExtension<Self, T>where
Self: Sized,
Source§fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
fn map_request_body<F>(self, f: F) -> MapRequestBody<Self, F>where
Self: Sized,
Source§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
Source§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
Source§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
Source§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Source§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
x-request-id as the header name. Read moreSource§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
500 Internal Server responses. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
413 Payload Too Large responses. Read more