Skip to content

cosmwasm-std: avoid dependency on std::error::Error #1785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion packages/std/src/errors/system_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ pub enum SystemError {
},
}

impl std::error::Error for SystemError {}
// We want to support no_std thus we don’t want to reference Error through
// std::error module. At the same time we don’t want to use core::error since
// that’s unstable. Fortunately, we can take advantage of serde which
// re-exports the trait as serde::de::StdError.
impl serde::de::StdError for SystemError {}

impl core::fmt::Display for SystemError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
Expand Down