StatusErrorf returns a new StatusError containing the specified status and message.
(status int, format string, a ...any)
| 9 | |
| 10 | // StatusErrorf returns a new StatusError containing the specified status and message. |
| 11 | func StatusErrorf(status int, format string, a ...any) StatusError { |
| 12 | var msg string |
| 13 | if len(a) > 0 { |
| 14 | msg = fmt.Sprintf(format, a...) |
| 15 | } else { |
| 16 | msg = format |
| 17 | } |
| 18 | |
| 19 | return StatusError{ |
| 20 | status: status, |
| 21 | msg: msg, |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | // StatusError error type that contains an HTTP status code and message. |
| 26 | type StatusError struct { |
no outgoing calls
no test coverage detected
searching dependent graphs…