We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc12684 commit a3d521eCopy full SHA for a3d521e
crates/signer/src/error.rs
@@ -1,6 +1,6 @@
1
use alloy_primitives::{hex, ChainId};
2
use k256::ecdsa;
3
-use std::fmt;
+use std::{fmt, fmt::Display};
4
use thiserror::Error;
5
6
/// Result type alias for [`Error`](enum@Error).
@@ -47,6 +47,12 @@ impl Error {
47
Self::Other(error.into())
48
}
49
50
+ /// Constructs a new [`Other`](Self::Other) with an error message.
51
+ #[cold]
52
+ pub fn message(err: impl Display) -> Self {
53
+ Self::Other(err.to_string().into())
54
+ }
55
+
56
/// Returns `true` if the error is [`UnsupportedOperation`](Self::UnsupportedOperation).
57
#[inline]
58
pub const fn is_unsupported(&self) -> bool {
0 commit comments