pub enum LivewireError {
Show 32 variants
MissingHeader,
NotJson {
content_type: Option<String>,
},
MalformedPayload(String),
InvalidSnapshot,
ModelNotFound {
class: String,
key: String,
},
Database {
message: String,
},
ValidationFailed {
errors: Map<String, Value>,
},
PolicyFailed {
method: String,
message: String,
},
MixedParameters,
InvalidRouteContext(String),
DefaultUpdateUriOverridden,
CorruptPayload,
ReleaseTokenMismatch,
MethodNotFound {
method: String,
},
LockedProperty {
property: String,
component: String,
},
HydrationFailed {
property: String,
component: String,
message: String,
},
TooManyChecksumFailures {
retry_after: u64,
},
ComponentNotFound {
name: String,
},
SynthNotFound {
key: String,
},
UnknownProperty {
property: String,
component: String,
},
PayloadTooLarge {
size: usize,
max: usize,
},
TooManyComponents {
count: usize,
max: usize,
},
TooManyCalls {
count: usize,
max: usize,
},
NestingDepthExceeded {
path: String,
max: usize,
},
RootTagMissing,
MultipleRootElements {
name: String,
},
EventListenerMissing {
event: String,
},
Unauthorized {
method: String,
},
InvalidUploadSignature,
InvalidSignedReference,
UploadValidation(String),
ViewNotFound {
view: String,
},
}Expand description
Something a Livewire request can go wrong with.
Variants§
MissingHeader
The update request has no X-Livewire header, so it did not come from the client.
NotJson
The update request’s content type is not JSON.
MalformedPayload(String)
The request body is not the JSON object the protocol defines.
InvalidSnapshot
A component’s snapshot is not the structure the protocol defines.
ModelNotFound
A model reference names a row that no longer exists.
Fields
Database
A database query the framework ran for a component failed.
ValidationFailed
A validation rule rejected the component’s state. The browser reads the messages from the snapshot, so this error is not an HTTP failure of its own: the response still renders.
PolicyFailed
An action’s policy failed, which is a server fault rather than a refusal: a policy that
refuses returns Ok(false).
MixedParameters
A call’s parameters mix positional and named parameters.
InvalidRouteContext(String)
The snapshot’s path, method, or route does not match the request that arrived.
DefaultUpdateUriOverridden
A custom update URI is configured, so the default route answers nothing.
CorruptPayload
The snapshot’s checksum does not match its contents.
ReleaseTokenMismatch
The snapshot was made by another deployment.
MethodNotFound
A call names a method the component does not publish.
LockedProperty
An update sets a property the component locked.
Fields
HydrationFailed
A value cannot be hydrated into the field it belongs to.
Fields
TooManyChecksumFailures
The client sent too many corrupt snapshots.
ComponentNotFound
The snapshot names a component the registry does not hold.
SynthNotFound
A snapshot or update names a synthesizer the registry does not hold.
UnknownProperty
An update sets a property that is not public on the wire.
Fields
PayloadTooLarge
The request body is larger than the configured limit.
Fields
TooManyComponents
The request updates more components than the configured limit.
TooManyCalls
The request makes more calls than the configured limit.
NestingDepthExceeded
An update sets a property path deeper than the configured limit.
RootTagMissing
A component’s view rendered no HTML element.
MultipleRootElements
A component’s view rendered more than one HTML element.
EventListenerMissing
The browser dispatched an event the component does not listen for.
The component’s policy denied the action.
Fields
The action that was denied.
InvalidUploadSignature
The upload endpoint’s URL signature is invalid or expired.
InvalidSignedReference
A temporary file reference is invalid or expired.
UploadValidation(String)
A temporary upload failed its validation.
ViewNotFound
A component resolved to a view that does not exist.
Implementations§
Source§impl LivewireError
impl LivewireError
Sourcepub fn status(&self) -> StatusCode
pub fn status(&self) -> StatusCode
The status the browser receives.
§Panics
Panics when 419 stops being a status code, which a Rust update would only do by breaking
the protocol’s own contract.
Sourcepub const fn renders_framework_error(&self) -> bool
pub const fn renders_framework_error(&self) -> bool
Whether upstream Livewire lets the framework render its debug page for this error instead of answering with the bare status. In production the status alone is the answer, so that a probing client learns nothing about the failure.
Sourcepub fn message(&self) -> String
pub fn message(&self) -> String
The message the browser receives in debug mode, and that the server logs otherwise.
Sourcepub fn into_response(self, debug: bool) -> Response
pub fn into_response(self, debug: bool) -> Response
The response for this error. In debug mode, errors upstream renders as a page answer with
the framework’s detailed error page; every other error answers with its status and, for a
429, the retry information.
Trait Implementations§
Source§impl Clone for LivewireError
impl Clone for LivewireError
Source§impl Debug for LivewireError
impl Debug for LivewireError
Source§impl Display for LivewireError
impl Display for LivewireError
impl Eq for LivewireError
Source§impl Error for LivewireError
impl Error for LivewireError
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()
Source§impl PartialEq for LivewireError
impl PartialEq for LivewireError
impl StructuralPartialEq for LivewireError
Auto Trait Implementations§
impl Forget for LivewireError
impl Freeze for LivewireErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
impl Move for LivewireError
impl RefUnwindSafe for LivewireError
impl Send for LivewireError
impl Sync for LivewireError
impl Unpin for LivewireError
impl UnsafeUnpin for LivewireErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
impl UnwindSafe for LivewireError
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
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.