pub trait IntoStdError {
// Required method
fn into_std_error(self) -> StdError;
}Expand description
A trait for converting Storey errors into cosmwasm_std::StdError.
Required Methods§
Sourcefn into_std_error(self) -> StdError
fn into_std_error(self) -> StdError
Converts the error into a cosmwasm_std::StdError for use with CosmWasm.
The error ends up as a cosmwasm_std::StdError::GenericErr with the error message
being the result of calling to_string on the error.
§Example
use cosmwasm_std::StdError;
use storey::containers::map::key::ArrayDecodeError;
use cw_storey::IntoStdError as _;
let error = ArrayDecodeError::InvalidLength;
assert_eq!(error.into_std_error(), StdError::generic_err(error.to_string()));