HTTPStatusCode returns a safe fallback for missing status codes.
()
| 47 | |
| 48 | // HTTPStatusCode returns a safe fallback for missing status codes. |
| 49 | func (e *AuthError) HTTPStatusCode() int { |
| 50 | if e == nil || e.StatusCode <= 0 { |
| 51 | return http.StatusInternalServerError |
| 52 | } |
| 53 | return e.StatusCode |
| 54 | } |
| 55 | |
| 56 | func newAuthError(code AuthErrorCode, message string, statusCode int, cause error) *AuthError { |
| 57 | return &AuthError{ |