diff options
Diffstat (limited to 'errors')
-rw-r--r-- | errors/errors.go | 2 | ||||
-rw-r--r-- | errors/status.go | 3 |
2 files changed, 5 insertions, 0 deletions
diff --git a/errors/errors.go b/errors/errors.go index 77d4d8c..3f1efc5 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -31,6 +31,8 @@ var ( ErrEmptyContactName = errors.New("Contact Name Cannot Be Empty") ErrInvalidGSTIN = errors.New("Invalid GSTIN") ErrInvalidEmail = errors.New("Invalid E-Mail Address") + ErrInvalidPhone = errors.New("Invalid Phone Number") + ErrInvalidWebsite = errors.New("Invalid Website URL") ErrEmptyBrandName = errors.New("Brand Name Cannot Be Empty") ErrInvalidUnitPrice = errors.New("Invalid Unit Price") ErrInvalidGSTPercentage = errors.New("Invalid GST Percentage") diff --git a/errors/status.go b/errors/status.go index 1fa33d1..7a23ddf 100644 --- a/errors/status.go +++ b/errors/status.go @@ -33,6 +33,9 @@ func StatusCodeFromErr(err error) int { errors.Is (err, ErrInvalidID) || errors.Is (err, ErrEmptyContactName) || errors.Is(err, ErrInvalidGSTIN) || + errors.Is(err, ErrInvalidEmail) || + errors.Is(err, ErrInvalidPhone) || + errors.Is(err, ErrInvalidWebsite) || errors.Is(err, ErrEmptyBrandName) || errors.Is(err, ErrInvalidUnitPrice) || errors.Is(err, ErrPasswordTooShort) || |