Function human_errors::user_with_cause[][src]

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

An error triggered by something the user has done, with a deeper cause.

Constructs a new Error describing a failure which was the result of an action that the user has taken. 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::user_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::user(
    "We could not find a file at /home/user/.config/demo.yml",
    "Make sure that the file exists and is readable by the application."
  )
);