Trait zellij_utils::errors::FatalError
source · pub trait FatalError<T> {
// Required methods
fn non_fatal(self);
fn fatal(self) -> T;
}
Expand description
Special trait to mark fatal/non-fatal errors.
This works in tandem with LoggableError
above and is meant to make reading code easier with
regard to whether an error is fatal or not (i.e. can be ignored, or at least doesn’t make the
application crash).
This essentially degrades any std::result::Result<(), _>
to a simple ()
.
Required Methods§
sourcefn non_fatal(self)
fn non_fatal(self)
Mark results as being non-fatal.
If the result is an Err
variant, this will print the error to the log.
Discards the result type afterwards.