system

Function system 

Source
pub fn system<T>(error: T, advice: &'static [&'static str]) -> Error
where T: Into<Box<dyn Error + Send + Sync>>,
Expand description

An error triggered by the system rather than the user, with a deeper cause.

Constructs a new Error describing a failure which was the result of a failure in the system, rather than a user’s action. This error includes a description of what occurred, as well as some advice for the user to try to mitigate the problem. It also includes the details of another error which resulted in this failure.

NOTE: The internal error may be any type which may be converted into a Box.

§Examples

use human_errors;

human_errors::system(
  "ENOENT 2: No such file or directory",
  &["Make sure that the file exists and is readable by the application."],
);