Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
minerva
frontend
Commits
ebe7e49a
Commit
ebe7e49a
authored
5 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
provide map for source files and source error to axios stacktrace
parent
4ced368a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!264
Resolve "add support for matomo"
,
!243
javascript stacktrace is improved
Pipeline
#95291
failed
5 months ago
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
next.config.js
+1
-0
1 addition, 0 deletions
next.config.js
src/services/api/utils/axiosInstance.ts
+36
-0
36 additions, 0 deletions
src/services/api/utils/axiosInstance.ts
with
37 additions
and
0 deletions
next.config.js
+
1
−
0
View file @
ebe7e49a
...
...
@@ -3,6 +3,7 @@ const nextConfig = {
reactStrictMode
:
true
,
basePath
:
process
.
env
.
APP_PREFIX
?
process
.
env
.
APP_PREFIX
+
'
/index.html
'
:
''
,
assetPrefix
:
process
.
env
.
APP_PREFIX
?
process
.
env
.
APP_PREFIX
:
''
,
productionBrowserSourceMaps
:
true
,
output
:
'
export
'
,
images
:
{
unoptimized
:
true
,
...
...
This diff is collapsed.
Click to expand it.
src/services/api/utils/axiosInstance.ts
+
36
−
0
View file @
ebe7e49a
...
...
@@ -8,3 +8,39 @@ export const axiosInstance = axios.create({
export
const
axiosInstanceNewAPI
=
axios
.
create
({
baseURL
:
BASE_NEW_API_URL
,
});
axiosInstance
.
interceptors
.
request
.
use
(
config
=>
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// eslint-disable-next-line no-param-reassign
config
.
errorContext
=
new
Error
(
'
Thrown at:
'
);
return
config
;
});
axiosInstance
.
interceptors
.
response
.
use
(
undefined
,
async
error
=>
{
const
originalStackTrace
=
error
.
config
?.
errorContext
?.
stack
;
if
(
originalStackTrace
)
{
// eslint-disable-next-line no-param-reassign
error
.
stack
=
`
${
error
.
stack
}
\n
${
originalStackTrace
}
`
;
}
throw
error
;
});
axiosInstanceNewAPI
.
interceptors
.
request
.
use
(
config
=>
{
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
// eslint-disable-next-line no-param-reassign
config
.
errorContext
=
new
Error
(
'
Thrown at:
'
);
return
config
;
});
axiosInstanceNewAPI
.
interceptors
.
response
.
use
(
undefined
,
async
error
=>
{
const
originalStackTrace
=
error
.
config
?.
errorContext
?.
stack
;
if
(
originalStackTrace
)
{
// eslint-disable-next-line no-param-reassign
error
.
stack
=
`
${
error
.
stack
}
\n
${
originalStackTrace
}
`
;
}
throw
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