diff options
Diffstat (limited to 'errors')
-rw-r--r-- | errors/errors.go | 1 | ||||
-rw-r--r-- | errors/status.go | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/errors/errors.go b/errors/errors.go index 3f1efc5..b5f4f63 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -38,6 +38,7 @@ var ( ErrInvalidGSTPercentage = errors.New("Invalid GST Percentage") ErrPasswordTooShort = errors.New("Password Is Too Short") ErrPasswordTooLong = errors.New("Password Is Too Long") + ErrInvalidLoginMethod = errors.New("Login Method Can Only Be 'email' Or 'username'") // 401 ErrWrongPassword = errors.New("Wrong Password") diff --git a/errors/status.go b/errors/status.go index 7a23ddf..c7fc2a4 100644 --- a/errors/status.go +++ b/errors/status.go @@ -40,6 +40,7 @@ func StatusCodeFromErr(err error) int { errors.Is(err, ErrInvalidUnitPrice) || errors.Is(err, ErrPasswordTooShort) || errors.Is(err, ErrPasswordTooLong) || + errors.Is(err, ErrInvalidLoginMethod) || errors.Is(err, ErrInvalidGSTPercentage) { return http.StatusBadRequest } |