Wrap creates a wrapped error with a specific Code and Explanation string. The wrapping method will automatically append the error message in brackets. - Cause is the original error that can be accessed with the Unwrap method. - Code is an error code allowing an administrator to identify the error
(Cause error, Code string, Explanation string, Args ...interface{})
| 64 | // - Args are the arguments to Explanation to create a formatted message. It is recommended that these arguments also |
| 65 | // be added as labels to allow system administrators to index the error properly. |
| 66 | func Wrap(Cause error, Code string, Explanation string, Args ...interface{}) WrappingMessage { |
| 67 | return &wrappingMessage{ |
| 68 | Message: NewMessage(Code, Explanation+" (%v)", append(Args, Cause)...), |
| 69 | cause: Cause, |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | // endregion |
| 74 |