mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: Rbac errors should be returned, and not hidden behind 404 (#7122)
* chore: Rbac errors should be returned, and not hidden behind 404 SqlErrNoRows was hiding actual errors * Replace sql.ErrNoRow checks * Remove sql err no rows check from dbauthz test * Fix to use dbauthz system user
This commit is contained in:
@ -34,8 +34,8 @@ func (e NotAuthorizedError) Error() string {
|
||||
|
||||
// Unwrap will always unwrap to a sql.ErrNoRows so the API returns a 404.
|
||||
// So 'errors.Is(err, sql.ErrNoRows)' will always be true.
|
||||
func (NotAuthorizedError) Unwrap() error {
|
||||
return sql.ErrNoRows
|
||||
func (e NotAuthorizedError) Unwrap() error {
|
||||
return e.Err
|
||||
}
|
||||
|
||||
func IsNotAuthorizedError(err error) bool {
|
||||
|
Reference in New Issue
Block a user