diff --git a/src/util/error.rs b/src/util/error.rs index 5c9c7e6..61e9470 100644 --- a/src/util/error.rs +++ b/src/util/error.rs @@ -74,6 +74,12 @@ impl Error { } } + /// Creates a new basic `Error` at this location with the given message + #[track_caller] + pub fn message_here>(message: S) -> Self { + Error::new(ErrorType::Error(message.into()), ErrorLocation::here()) + } + /// Adds a context message to the error #[track_caller] pub fn with_context(mut self, context: impl Into) -> Self {