Function human_errors::system_with_cause[][src]

pub fn system_with_cause(description: &str, advice: &str, cause: Error) -> Error

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, as well as any advice that error may provide.

Examples

use human_errors;
 
human_errors::system_with_cause(
  "We could not open the config file you provided.",
  "Make sure that you've specified a valid config file with the --config option.",
  human_errors::system(
    "We could not find a file at /home/user/.config/demo.yml",
    "Make sure that the file exists and is readable by the application."
  )
);