Function human_errors::user_with_internal[][src]

pub fn user_with_internal<T>(
    description: &str,
    advice: &str,
    internal: T
) -> Error where
    T: Into<Box<dyn Error + Send + Sync>>, 

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.

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

Examples

use human_errors;
 
human_errors::user_with_internal(
  "We could not open the config file you provided.",
  "Make sure that the file exists and is readable by the application.",
  human_errors::detailed_message("ENOENT 2: No such file or directory")
);