Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
GitHub Mirror
Renovate Bot
renovate
Commits
4a71b5ba
"manifests/prometheusOperator-clusterRoleBinding.yaml" did not exist on "beaba9f4da877b89125c3b55467367c54ec77814"
Commit
4a71b5ba
authored
5 years ago
by
Rhys Arkins
Browse files
Options
Downloads
Patches
Plain Diff
fix(gitFs): rewrite git 5xx errors to platform-failure
parent
a6a6e472
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/workers/repository/error.js
+10
-0
10 additions, 0 deletions
lib/workers/repository/error.js
test/workers/repository/error.spec.js
+7
-0
7 additions, 0 deletions
test/workers/repository/error.spec.js
with
17 additions
and
0 deletions
lib/workers/repository/error.js
+
10
−
0
View file @
4a71b5ba
...
...
@@ -120,6 +120,16 @@ async function handleError(config, err) {
delete
config
.
branchList
;
// eslint-disable-line no-param-reassign
return
err
.
message
;
}
if
(
err
.
message
.
includes
(
'
unable to access
'
)
&&
err
.
message
.
includes
(
'
The requested URL returned error: 5
'
)
)
{
logger
.
debug
({
err
},
'
git 5xx error
'
);
logger
.
warn
(
'
Git error - aborting
'
);
delete
config
.
branchList
;
// eslint-disable-line no-param-reassign
// rewrite this error
return
'
platform-failure
'
;
}
// Swallow this error so that other repositories can be processed
logger
.
error
({
err
},
`Repository has unknown error`
);
// delete branchList to avoid cleaning up branches
...
...
This diff is collapsed.
Click to expand it.
test/workers/repository/error.spec.js
+
7
−
0
View file @
4a71b5ba
...
...
@@ -41,6 +41,13 @@ describe('workers/repository/error', () => {
expect
(
res
).
toEqual
(
err
);
});
});
it
(
'
rewrites git error
'
,
async
()
=>
{
const
gitError
=
new
Error
(
"
fatal: unable to access 'https://**redacted**@gitlab.com/learnox/learnox.git/': The requested URL returned error: 500
\n
"
);
const
res
=
await
handleError
(
config
,
gitError
);
expect
(
res
).
toEqual
(
'
platform-failure
'
);
});
it
(
'
handles unknown error
'
,
async
()
=>
{
const
res
=
await
handleError
(
config
,
new
Error
(
'
abcdefg
'
));
expect
(
res
).
toEqual
(
'
unknown-error
'
);
...
...
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