Commit bf620a10 authored by Kim, Subin's avatar Kim, Subin
Browse files

utils/catchErrors 추가

parent 247c9892
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment