wrap_err

Function wrap_err 

Source
pub fn wrap_err<T>(msg: &str, src: T) -> TinkError
where T: Error + Send + 'static,
Expand description

Wrap an error with an additional message. This utility is intended to help with porting Go code to Rust, to cover patterns like:

  thing, err := FunctionCall()
  if err != nil {
    return nil, fmt.Errorf("FunctionCall failed: %s", err)
  }