diff options
author | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-13 01:32:27 +0530 |
---|---|---|
committer | Vidhu Kant Sharma <vidhukant@vidhukant.com> | 2025-10-13 01:32:27 +0530 |
commit | 0f435049cb3cc6900d881c5dce43bec3a1e60e2e (patch) | |
tree | 374950fba5605ea8411da428ac94b1deef4e2809 /errors | |
parent | fb9ba155438100f295fdb563ad955151ee038ad3 (diff) |
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 de18bf4..3c37e08 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -44,6 +44,7 @@ var ( ErrUsernameTooShort = errors.New("Username Is Too Short") ErrUsernameTooLong = errors.New("Username Is Too Long") ErrInvalidLoginMethod = errors.New("Login Method Can Only Be 'email' Or 'username'") + ErrNoItemVariants = errors.New("An item should have at least one variant") // 401 ErrWrongPassword = errors.New("Wrong Password") diff --git a/errors/status.go b/errors/status.go index 306ea27..0bbb7ba 100644 --- a/errors/status.go +++ b/errors/status.go @@ -41,6 +41,7 @@ func StatusCodeFromErr(err error) int { errors.Is(err, ErrPasswordTooShort) || errors.Is(err, ErrPasswordTooLong) || errors.Is(err, ErrInvalidLoginMethod) || + errors.Is(err, ErrNoItemVariants) || errors.Is(err, ErrInvalidGSTPercentage) { return http.StatusBadRequest } |