Enum cosmwasm_std::StdError [−][src]
pub enum StdError { VerificationErr { source: VerificationError, }, RecoverPubkeyErr { source: RecoverPubkeyError, }, GenericErr { msg: String, }, InvalidBase64 { msg: String, }, InvalidDataSize { expected: u64, actual: u64, }, InvalidUtf8 { msg: String, }, NotFound { kind: String, }, ParseErr { target_type: String, msg: String, }, SerializeErr { source_type: String, msg: String, }, Overflow { source: OverflowError, }, DivideByZero { source: DivideByZeroError, }, }
Expand description
Structured error type for init, execute 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 creator function in std_error_helpers.rs
Variants
Show fields
Fields of VerificationErr
source: VerificationError
Show fields
Fields of RecoverPubkeyErr
source: RecoverPubkeyError
Whenever there is no specific error type available
Show fields
Fields of GenericErr
msg: String
Show fields
Fields of InvalidBase64
msg: String
Whenever UTF-8 bytes cannot be decoded into a unicode string, e.g. in String::from_utf8 or str::from_utf8.
Show fields
Fields of InvalidUtf8
msg: String
Show fields
Fields of NotFound
kind: String
Show fields
Fields of Overflow
source: OverflowError
Implementations
Trait Implementations
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for StdError
impl UnwindSafe for StdError