Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ce-deploy-ui
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ccce
dev
ce-deploy-ui
Commits
3ed4a5b5
Commit
3ed4a5b5
authored
7 months ago
by
Anders Lindh Olsson
Browse files
Options
Downloads
Patches
Plain Diff
Set body and status code if error from requestHandler
parent
aaac9030
No related branches found
No related tags found
2 merge requests
!542
Prepare 4.1.0
,
!525
CE-3072: Updated failing liveIocStatus test
Pipeline
#195928
passed
7 months ago
Stage: setup
Stage: check
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cypress/support/interceptAPI.js
+14
-6
14 additions, 6 deletions
cypress/support/interceptAPI.js
with
14 additions
and
6 deletions
cypress/support/interceptAPI.js
+
14
−
6
View file @
3ed4a5b5
...
...
@@ -2,12 +2,20 @@ import { apiHandlers } from "../../src/mocks/mockAPI";
const
glue
=
(
requestHandler
)
=>
{
return
(
req
)
=>
{
const
d
=
requestHandler
(
req
);
req
.
reply
({
body
:
d
.
body
,
statusCode
:
d
.
status
??
200
,
headers
:
d
.
headers
});
try
{
const
res
=
requestHandler
(
req
);
req
.
reply
({
body
:
res
.
body
,
statusCode
:
res
.
status
??
200
,
headers
:
res
.
headers
});
}
catch
(
err
)
{
console
.
error
(
"
Error in requestHandler:
"
,
err
);
req
.
reply
({
body
:
{
error
:
"
Internal server error
"
},
statusCode
:
500
});
}
};
};
...
...
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