GODT-1358: Fix wording

This commit is contained in:
Alexander Bilyak
2021-10-07 11:18:40 +00:00
committed by Jakub
parent ef051d5ed6
commit 94347d95df
12 changed files with 43 additions and 17 deletions

View File

@ -28,6 +28,7 @@ var (
ErrBad2FACodeTryAgain = errors.New("incorrect 2FA code: please try again")
ErrPaidPlanRequired = errors.New("paid subscription plan is required")
ErrPasswordWrong = errors.New("wrong password")
)
type ErrUnprocessableEntity struct {

View File

@ -31,6 +31,7 @@ import (
const (
errCodeUpgradeApplication = 5003
errCodePasswordWrong = 8002
errCodeAuthPaidPlanRequired = 10004
)
@ -61,6 +62,8 @@ func (m *manager) catchAPIError(_ *resty.Client, res *resty.Response) error {
if m.cfg.UpgradeApplicationHandler != nil {
m.cfg.UpgradeApplicationHandler()
}
case apiErr.Code == errCodePasswordWrong:
err = ErrPasswordWrong
case apiErr.Code == errCodeAuthPaidPlanRequired:
err = ErrPaidPlanRequired
case res.StatusCode() == http.StatusUnprocessableEntity: