NewUnauthorizedError creates and returns 401 ApiError.
(message string, rawErrData any)
| 92 | |
| 93 | // NewUnauthorizedError creates and returns 401 ApiError. |
| 94 | func NewUnauthorizedError(message string, rawErrData any) *ApiError { |
| 95 | if message == "" { |
| 96 | message = "Missing or invalid authentication." |
| 97 | } |
| 98 | |
| 99 | return NewApiError(http.StatusUnauthorized, message, rawErrData) |
| 100 | } |
| 101 | |
| 102 | // NewInternalServerError creates and returns 500 ApiError. |
| 103 | func NewInternalServerError(message string, rawErrData any) *ApiError { |
searching dependent graphs…