diff --git a/src/artifacts/error.rs b/src/artifacts/error.rs index 4c96f6bd..ef273ab5 100644 --- a/src/artifacts/error.rs +++ b/src/artifacts/error.rs @@ -99,6 +99,23 @@ pub struct Error { pub formatted_message: Option, } +impl Error { + /// Returns `true` if the error is an error. + pub const fn is_error(&self) -> bool { + self.severity.is_error() + } + + /// Returns `true` if the error is a warning. + pub const fn is_warning(&self) -> bool { + self.severity.is_warning() + } + + /// Returns `true` if the error is an info. + pub const fn is_info(&self) -> bool { + self.severity.is_info() + } +} + /// Tries to mimic Solidity's own error formatting. /// ///