region Factories UserMessage constructs a Message. - 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 needed. - Explanation is the explanation string to the system administrator. This is an fmt.Sprin
(Code string, UserMessage string, Explanation string, Args ...interface{})
| 14 | // - Args are the arguments to Explanation to create a formatted message. It is recommended that these arguments also |
| 15 | // be added as labels to allow system administrators to index the error properly. |
| 16 | func UserMessage(Code string, UserMessage string, Explanation string, Args ...interface{}) Message { |
| 17 | return &message{ |
| 18 | code: Code, |
| 19 | userMessage: UserMessage, |
| 20 | explanation: fmt.Sprintf(Explanation, Args...), |
| 21 | labels: map[LabelName]LabelValue{}, |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // WrapUser creates a Message wrapping an error with a user-facing message. |
| 26 | // |
no outgoing calls