Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
travel
Commits
eef9d0c4
Commit
eef9d0c4
authored
Jul 07, 2022
by
Yoon, Daeki
😅
Browse files
catchErrors 함수 추가
parent
fef3942c
Changes
2
Show whitespace changes
Inline
Side-by-side
frontend/src/helpers/catchErrors.ts
0 → 100644
View file @
eef9d0c4
export
const
catchErrors
=
(
error
:
any
,
dispalyError
:
Function
)
=>
{
let
errorMsg
;
if
(
error
.
response
)
{
errorMsg
=
error
.
response
.
data
;
console
.
log
(
"
Error response:
"
,
errorMsg
);
}
else
if
(
error
.
request
)
{
errorMsg
=
error
.
request
;
console
.
log
(
"
Error request:
"
,
errorMsg
);
}
else
{
errorMsg
=
error
.
message
;
console
.
log
(
"
Error message:
"
,
errorMsg
);
}
dispalyError
(
errorMsg
);
};
frontend/src/helpers/index.ts
0 → 100644
View file @
eef9d0c4
export
{
catchErrors
}
from
"
./catchErrors
"
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment