IsUnauthorizedError is a convenience function to check if err is UnauthorizedError. It is equivalent to errors.As(err, &UnauthorizedError{}).
(err error)
| 47 | // IsUnauthorizedError is a convenience function to check if err is UnauthorizedError. |
| 48 | // It is equivalent to errors.As(err, &UnauthorizedError{}). |
| 49 | func IsUnauthorizedError(err error) bool { |
| 50 | return errors.As(err, &UnauthorizedError{}) |
| 51 | } |
| 52 | |
| 53 | // ForbiddenWithInternal creates a new error that will return a simple |
| 54 | // "forbidden" to the client, logging internally the more detailed message |