Skip to content

Commit 28447c9

Browse files
authored
Merge pull request #506 from trevor-crypto/impl-error
Add std Error impl for error types
2 parents e4ae872 + 5d4b9b0 commit 28447c9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

rust/src/error.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ impl std::fmt::Display for DeserializeError {
130130
}
131131
}
132132

133+
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
134+
impl std::error::Error for DeserializeError {}
135+
133136
impl From<DeserializeError> for JsError {
134137
fn from(e: DeserializeError) -> JsError {
135138
JsError::from_str(&e.to_string())
@@ -202,3 +205,6 @@ impl std::fmt::Display for JsError {
202205
write!(f, "{}", self.msg)
203206
}
204207
}
208+
209+
#[cfg(not(all(target_arch = "wasm32", not(target_os = "emscripten"))))]
210+
impl std::error::Error for JsError {}

0 commit comments

Comments
 (0)