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
survey
Commits
02bd3481
Commit
02bd3481
authored
Jul 05, 2022
by
Yoon, Daeki
😅
Browse files
에러 메시지 출력 추가
parent
8290c382
Changes
2
Show whitespace changes
Inline
Side-by-side
frontend/src/helpers/catchErrors.ts
0 → 100644
View file @
02bd3481
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 @
02bd3481
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