pub enum ErrorOrigin {
Parse,
Internal,
}Expand description
Which upstream throw an error corresponds to, and therefore which body a client sees.
handleParseErrors branches on the type of the thrown value rather than on its code
(middlewares.js:596-646). A Parse.Error renders its own message; anything else renders a
fixed one and the detail goes only to the log. So the same detail is a disclosure or not
depending on which of the two it travelled in, and the code alone cannot tell them apart:
upstream throws Parse.Error(INTERNAL_SERVER_ERROR, ...) deliberately in several places
(Auth.js:195, DatabaseController.js:1590-1595) and those keep their messages.
No Default impl, deliberately. A forgotten field would select the disclosing variant,
which is the failure this enum exists to prevent. Every value is chosen by a constructor.
Variants§
Parse
A Parse.Error. The message is wire-visible.
Internal
A bare Error upstream. The message is server-side detail and never reaches a client.
Trait Implementations§
Source§impl Clone for ErrorOrigin
impl Clone for ErrorOrigin
Source§fn clone(&self) -> ErrorOrigin
fn clone(&self) -> ErrorOrigin
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ErrorOrigin
Source§impl Debug for ErrorOrigin
impl Debug for ErrorOrigin
impl Eq for ErrorOrigin
Source§impl PartialEq for ErrorOrigin
impl PartialEq for ErrorOrigin
impl StructuralPartialEq for ErrorOrigin
Auto Trait Implementations§
impl Freeze for ErrorOrigin
impl RefUnwindSafe for ErrorOrigin
impl Send for ErrorOrigin
impl Sync for ErrorOrigin
impl Unpin for ErrorOrigin
impl UnsafeUnpin for ErrorOrigin
impl UnwindSafe for ErrorOrigin
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§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.