pub struct OnApiErrorOptions {
pub throw: bool,
pub error_url: Option<String>,
pub default_error_page: DefaultErrorPage,
pub on_error: Option<Arc<dyn OnApiErrorHandler>>,
}Expand description
Configuration for unhandled API errors.
Fields§
§throw: boolWhen true, internal errors propagate instead of returning JSON/redirect responses.
error_url: Option<String>Default redirect target for OAuth-style error flows.
default_error_page: DefaultErrorPage§on_error: Option<Arc<dyn OnApiErrorHandler>>Implementations§
Source§impl OnApiErrorOptions
impl OnApiErrorOptions
pub fn new() -> Self
pub fn throw(self, throw: bool) -> Self
pub fn error_url(self, url: impl Into<String>) -> Self
pub fn default_error_page(self, page: DefaultErrorPage) -> Self
pub fn on_error<H>(self, handler: H) -> Selfwhere
H: OnApiErrorHandler,
Trait Implementations§
Source§impl Clone for OnApiErrorOptions
impl Clone for OnApiErrorOptions
Source§fn clone(&self) -> OnApiErrorOptions
fn clone(&self) -> OnApiErrorOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OnApiErrorOptions
impl Debug for OnApiErrorOptions
Source§impl Default for OnApiErrorOptions
impl Default for OnApiErrorOptions
Source§fn default() -> OnApiErrorOptions
fn default() -> OnApiErrorOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for OnApiErrorOptions
impl !UnwindSafe for OnApiErrorOptions
impl Freeze for OnApiErrorOptions
impl Send for OnApiErrorOptions
impl Sync for OnApiErrorOptions
impl Unpin for OnApiErrorOptions
impl UnsafeUnpin for OnApiErrorOptions
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
Mutably borrows from an owned value. Read more