forked from Silverfish/proton-bridge
GODT-1210: "free user" banner
This commit is contained in:
@ -26,6 +26,8 @@ var (
|
||||
|
||||
ErrBad2FACode = errors.New("incorrect 2FA code")
|
||||
ErrBad2FACodeTryAgain = errors.New("incorrect 2FA code: please try again")
|
||||
|
||||
ErrPaidPlanRequired = errors.New("paid subscription plan is required")
|
||||
)
|
||||
|
||||
type ErrUnprocessableEntity struct {
|
||||
|
||||
@ -30,7 +30,8 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
errCodeUpgradeApplication = 5003
|
||||
errCodeUpgradeApplication = 5003
|
||||
errCodeAuthPaidPlanRequired = 10004
|
||||
)
|
||||
|
||||
type Error struct {
|
||||
@ -60,6 +61,8 @@ func (m *manager) catchAPIError(_ *resty.Client, res *resty.Response) error {
|
||||
if m.cfg.UpgradeApplicationHandler != nil {
|
||||
m.cfg.UpgradeApplicationHandler()
|
||||
}
|
||||
case apiErr.Code == errCodeAuthPaidPlanRequired:
|
||||
err = ErrPaidPlanRequired
|
||||
case res.StatusCode() == http.StatusUnprocessableEntity:
|
||||
err = ErrUnprocessableEntity{apiErr}
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user