diff options
Diffstat (limited to 'errors/status.go')
| -rw-r--r-- | errors/status.go | 8 | 
1 files changed, 8 insertions, 0 deletions
diff --git a/errors/status.go b/errors/status.go index b0da1ae..4767aeb 100644 --- a/errors/status.go +++ b/errors/status.go @@ -41,6 +41,14 @@ func StatusCodeFromErr(err error) int {  		return http.StatusBadRequest  	} +	// 401 +	if errors.Is(err, ErrWrongPassword) || +		errors.Is(err, ErrUnauthorized) || +		errors.Is(err, ErrInvalidAuthHeader) || +		errors.Is(err, ErrSessionExpired) { +		return http.StatusUnauthorized +	} +  	// 404  	if errors.Is(err, ErrNotFound) ||  		errors.Is(err, ErrBrandNotFound) {  |