Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoCLI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
UI
DojoCLI
Commits
8841a7dc
Commit
8841a7dc
authored
2 years ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
Convert status code numbers to the StatusCode library
parent
ae4e4fd7
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
NodeApp/src/managers/HttpManager.ts
+2
-2
2 additions, 2 deletions
NodeApp/src/managers/HttpManager.ts
NodeApp/src/managers/SessionManager.ts
+1
-1
1 addition, 1 deletion
NodeApp/src/managers/SessionManager.ts
with
3 additions
and
3 deletions
NodeApp/src/managers/HttpManager.ts
+
2
−
2
View file @
8841a7dc
...
...
@@ -75,11 +75,11 @@ class HttpManager {
if
(
this
.
handleCommandErrors
)
{
if
(
error
.
response
.
url
&&
error
.
response
.
url
.
indexOf
(
Config
.
apiURL
)
!==
-
1
)
{
switch
(
error
.
response
.
status
)
{
case
401
:
// Unauthorized
case
StatusCodes
.
UNAUTHORIZED
:
// Unauthorized
logger
.
error
(
'
Session expired or inexistent. Please login again.
'
);
process
.
exit
(
1
);
break
;
case
403
:
// Forbidden
case
StatusCodes
.
FORBIDDEN
:
// Forbidden
logger
.
error
(
'
Forbidden access.
'
);
process
.
exit
(
1
);
break
;
...
...
This diff is collapsed.
Click to expand it.
NodeApp/src/managers/SessionManager.ts
+
1
−
1
View file @
8841a7dc
...
...
@@ -63,7 +63,7 @@ class SessionManager {
}
catch
(
error
)
{
if
(
error
instanceof
AxiosError
)
{
if
(
error
.
response
)
{
if
(
error
.
response
.
status
===
404
)
{
if
(
error
.
response
.
status
===
StatusCodes
.
NOT_FOUND
)
{
spinner
.
fail
(
'
User not found or password incorrect
'
);
}
else
{
spinner
.
fail
(
`Login error:
${
error
.
response
.
statusText
}
`
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment