WrapUser creates a Message wrapping an error with a user-facing message. - 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 that happened. - UserMessage is the message that can be printed to the user if
(Cause error, Code string, User string, Explanation string, Args ...interface{})
| 33 | // |
| 34 | //goland:noinspection GoUnusedExportedFunction |
| 35 | func WrapUser(Cause error, Code string, User string, Explanation string, Args ...interface{}) WrappingMessage { |
| 36 | return &wrappingMessage{ |
| 37 | Message: UserMessage(Code, User, Explanation+" (%v)", append(Args, Cause)...), |
| 38 | cause: Cause, |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // NewMessage creates an internal error with only the explanation for the administrator inserted. |
| 43 | // |
no test coverage detected