FormatError annotates an HTTP response error with user-friendly messages
(action string, err error)
| 1173 | |
| 1174 | // FormatError annotates an HTTP response error with user-friendly messages |
| 1175 | func FormatError(action string, err error) error { |
| 1176 | if e, ok := err.(*errorInfo); ok { |
| 1177 | return formatError(action, e) |
| 1178 | } |
| 1179 | return err |
| 1180 | } |
| 1181 | |
| 1182 | func formatError(action string, e *errorInfo) error { |
| 1183 | var reason string |
searching dependent graphs…