Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arkindex
Frontend
Commits
82025ada
Commit
82025ada
authored
2 years ago
by
Erwan Rouchet
Committed by
Bastien Abadie
2 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Type the main module
parent
3953b73e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1375
Type the main module
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main.ts
+4
-3
4 additions, 3 deletions
src/main.ts
vue.config.js
+0
-4
0 additions, 4 deletions
vue.config.js
with
4 additions
and
7 deletions
src/main.
j
s
→
src/main.
t
s
+
4
−
3
View file @
82025ada
...
...
@@ -50,6 +50,7 @@ axios.interceptors.response.use(response => {
if
(
responseType
.
startsWith
(
'
text/html
'
)
&&
typeof
response
.
data
===
'
string
'
)
{
const
err
=
new
Error
(
'
Not found.
'
)
// @ts-expect-error Upgrade to Axios 1.x required to work with Axios errors properly
err
.
response
=
response
return
Promise
.
reject
(
err
)
}
...
...
@@ -71,7 +72,7 @@ axios.interceptors.response.use(response => {
)
return
Promise
.
reject
(
error
)
// Get the request path, without the host
let
path
=
null
let
path
:
string
|
null
=
null
try
{
path
=
error
.
request
?
new
URL
(
error
.
request
.
responseURL
).
pathname
:
null
}
catch
(
e
)
{
...
...
@@ -80,7 +81,7 @@ axios.interceptors.response.use(response => {
// Remove UUIDs to get the original API endpoint paths
if
(
path
)
path
=
path
.
replace
(
new
RegExp
(
UUID
),
'
<uuid>
'
)
let
fingerprint
=
[]
let
fingerprint
:
string
[]
=
[]
if
(
error
.
response
)
{
/*
* Error with a response from the backend
...
...
@@ -95,7 +96,7 @@ axios.interceptors.response.use(response => {
]
}
else
if
(
error
.
request
)
{
// Error without any response
fingerprint
=
[
'
axios-error-request
'
,
path
]
fingerprint
=
[
'
axios-error-request
'
,
path
??
''
]
}
else
{
// Error occurring before sending the request
fingerprint
=
[
'
axios-error-setup
'
,
error
]
...
...
This diff is collapsed.
Click to expand it.
vue.config.js
+
0
−
4
View file @
82025ada
...
...
@@ -12,10 +12,6 @@ process.env.VUE_APP_VERSION = process.env.NODE_ENV === 'development' ? `${versio
module
.
exports
=
defineConfig
({
lintOnSave
:
false
,
chainWebpack
:
config
=>
{
// We have enabled TypeScript, but we do not have a src/main.ts yet, so we have to override the entrypoint Vue defines
config
.
entry
(
'
app
'
).
clear
()
config
.
entry
(
'
app
'
).
add
(
'
./src/main.js
'
)
config
.
plugin
(
'
lodash
'
)
.
use
(
LodashModuleReplacementPlugin
,
[{
...
...
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