Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
egl_konnector
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
web-et-numerique
Factory
LLLE_Project
egl_konnector
Commits
433c2f55
Commit
433c2f55
authored
4 years ago
by
Yoan VALLET
Browse files
Options
Downloads
Patches
Plain Diff
clean code
parent
a1bcf881
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/index.js
+8
-12
8 additions, 12 deletions
src/index.js
with
8 additions
and
12 deletions
src/index.js
+
8
−
12
View file @
433c2f55
...
...
@@ -105,15 +105,11 @@ async function authenticate(login, password, baseUrl, apiAuthKey) {
},
json
:
true
}
try
{
const
response
=
await
rp
(
authRequest
)
if
(
response
.
codeRetour
===
100
)
{
return
response
}
else
{
throw
new
Error
(
errors
.
LOGIN_FAILED
)
}
}
catch
(
error
)
{
throw
error
const
response
=
await
rp
(
authRequest
)
if
(
response
.
codeRetour
===
100
)
{
return
response
}
else
{
throw
new
Error
(
errors
.
LOGIN_FAILED
)
}
}
...
...
@@ -136,10 +132,10 @@ async function getData(response, baseUrl, apiAuthKey) {
json
:
true
}
try
{
const
response
=
await
rp
(
dataRequest
)
switch
(
response
.
codeRetour
)
{
const
response
Egl
=
await
rp
(
dataRequest
)
switch
(
response
Egl
.
codeRetour
)
{
case
100
:
return
format
(
response
)
return
format
(
response
Egl
)
case
-
2
:
throw
new
Error
(
errors
.
LOGIN_FAILED
)
case
-
1
:
...
...
This diff is collapsed.
Click to expand it.
Yoan VALLET
@yvallet
mentioned in commit
d8036ac7
·
4 years ago
mentioned in commit
d8036ac7
mentioned in commit d8036ac7eaddba931166633acd0c79ee4f648400
Toggle commit list
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