[−][src]Enum cosmwasm_std::StdError
Structured error type for init, handle and query.
This can be serialized and passed over the Wasm/VM boundary, which allows us to use structured error types in e.g. integration tests. In that process backtraces are stripped off.
The prefix "Std" means "the standard error within the standard library". This is not the only result/error type in cosmwasm-std.
When new cases are added, they should describe the problem rather than what was attempted (e.g. InvalidBase64 is preferred over Base64DecodingErr). In the long run this allows us to get rid of the duplication in "StdError::FooErr".
Checklist for adding a new error:
- Add enum case
- Add to PartialEq implementation
- Add serialize/deserialize test
- Add creator function in std_error_helpers.rs
- Regenerate schemas
Variants (Non-exhaustive)
Whenever there is no specific error type available
Whenever UTF-8 bytes cannot be decoded into a unicode string, e.g. in String::from_utf8 or str::from_utf8.
Fields of ParseErr
Fields of SerializeErr
Fields of Unauthorized
Trait Implementations
impl Debug for StdError
[src]
impl<'de> Deserialize<'de> for StdError
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for StdError
[src]
impl Error for StdError where
Self: Debug + Display,
[src]
Self: Debug + Display,
fn description(&self) -> &str
[src]
fn cause(&self) -> Option<&dyn Error>
[src]
fn source(&self) -> Option<&(dyn Error + 'static)>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
impl ErrorCompat for StdError
[src]
impl JsonSchema for StdError
[src]
fn schema_name() -> String
[src]
fn json_schema(gen: &mut SchemaGenerator) -> Schema
[src]
fn is_referenceable() -> bool
[src]
impl PartialEq<StdError> for StdError
[src]
fn eq(&self, other: &Self) -> bool
[src]
Two errors are considered equal if and only if their payloads (i.e. all fields other than backtrace) are equal.
The origin of the error (expressed by its backtrace) is ignored, which allows equality checks on errors and results in tests. This is a property that might not always be desired depending on the use case and something you should be aware of.
Note: We destruct the unused backtrace as _ to avoid the use of ..
which silently ignores newly added fields.
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for StdError
[src]
Auto Trait Implementations
impl RefUnwindSafe for StdError
impl Send for StdError
impl Sync for StdError
impl Unpin for StdError
impl UnwindSafe for StdError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsErrorSource for T where
T: 'static + Error,
[src]
T: 'static + Error,
fn as_error_source(&self) -> &(dyn Error + 'static)
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,