Skip to content

Commit d797472

Browse files
committed
refactor(migration): move planka error codes to the 142xx range
address review comment
1 parent edd46b7 commit d797472

2 files changed

Lines changed: 10 additions & 10 deletions

File tree

frontend/src/i18n/lang/en.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1520,10 +1520,10 @@
15201520
"14001": "The provided api token is invalid.",
15211521
"14002": "The permission {permission} of group {group} is invalid.",
15221522
"14005": "A migration from this service is already running. Please wait until it is done.",
1523-
"14006": "Planka rejected the provided credentials. Check the URL and the API key or username and password.",
1524-
"14007": "The Planka account requires an extra login step (two-factor code or accepting the terms). Log in to Planka in the browser once, or use an API key instead of username and password.",
1525-
"14009": "A Planka URL and either an API key or username and password are required.",
1526-
"14010": "Could not reach a Planka API at the given URL. Check the URL and that Vikunja can reach the instance."
1523+
"14201": "Planka rejected the provided credentials. Check the URL and the API key or username and password.",
1524+
"14202": "The Planka account requires an extra login step (two-factor code or accepting the terms). Log in to Planka in the browser once, or use an API key instead of username and password.",
1525+
"14203": "A Planka URL and either an API key or username and password are required.",
1526+
"14204": "Could not reach a Planka API at the given URL. Check the URL and that Vikunja can reach the instance."
15271527
},
15281528
"about": {
15291529
"title": "About",

pkg/modules/migration/planka/errors.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (err *ErrInvalidCredentials) Error() string {
3030
}
3131

3232
// ErrCodeInvalidCredentials holds the unique world-error code of this error
33-
const ErrCodeInvalidCredentials = 14006
33+
const ErrCodeInvalidCredentials = 14201
3434

3535
// HTTPError holds the http error description
3636
func (err *ErrInvalidCredentials) HTTPError() web.HTTPError {
@@ -51,14 +51,14 @@ func (err *ErrLoginStepRequired) Error() string {
5151
return "The Planka account requires an extra login step: " + err.Step
5252
}
5353

54-
// ErrCodeTOTPRequired holds the unique world-error code of this error
55-
const ErrCodeTOTPRequired = 14007
54+
// ErrCodeLoginStepRequired holds the unique world-error code of this error
55+
const ErrCodeLoginStepRequired = 14202
5656

5757
// HTTPError holds the http error description
5858
func (err *ErrLoginStepRequired) HTTPError() web.HTTPError {
5959
return web.HTTPError{
6060
HTTPCode: http.StatusBadRequest,
61-
Code: ErrCodeTOTPRequired,
61+
Code: ErrCodeLoginStepRequired,
6262
Message: "The Planka account requires an extra login step (two-factor code or accepting the terms). Log in to Planka in the browser once, or use an API key instead of username and password.",
6363
I18nParams: map[string]string{"step": err.Step},
6464
}
@@ -79,7 +79,7 @@ func (err *ErrInvalidConfig) Error() string {
7979
}
8080

8181
// ErrCodeInvalidConfig holds the unique world-error code of this error
82-
const ErrCodeInvalidConfig = 14009
82+
const ErrCodeInvalidConfig = 14203
8383

8484
// HTTPError holds the http error description
8585
func (err *ErrInvalidConfig) HTTPError() web.HTTPError {
@@ -100,7 +100,7 @@ func (err *ErrNoPlankaAtURL) Error() string {
100100
}
101101

102102
// ErrCodeNoPlankaAtURL holds the unique world-error code of this error
103-
const ErrCodeNoPlankaAtURL = 14010
103+
const ErrCodeNoPlankaAtURL = 14204
104104

105105
// HTTPError holds the http error description
106106
func (err *ErrNoPlankaAtURL) HTTPError() web.HTTPError {

0 commit comments

Comments
 (0)