Error returns a text representation of the error.
()
| 14 | |
| 15 | // Error returns a text representation of the error. |
| 16 | func (e *Error) Error() string { |
| 17 | if e.details == "" { |
| 18 | return e.reason |
| 19 | } |
| 20 | |
| 21 | return fmt.Sprintf("%s: %s", e.reason, e.details) |
| 22 | } |
| 23 | |
| 24 | // AddDetails adds details to an error, with additional text. |
| 25 | func (e *Error) AddDetails(format string, args ...interface{}) *Error { |
no outgoing calls