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
Today KU
Commits
bf620a10
Commit
bf620a10
authored
Oct 12, 2021
by
Kim, Subin
Browse files
utils/catchErrors 추가
parent
247c9892
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/utils/catchErrors.js
0 → 100644
View file @
bf620a10
const
catchErrors
=
(
error
,
displayError
)
=>
{
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
)
}
displayError
(
errorMsg
)
alert
(
errorMsg
)
}
export
default
catchErrors
\ No newline at end of file
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