Commit 02bd3481 authored by Yoon, Daeki's avatar Yoon, Daeki 😅
Browse files

에러 메시지 출력 추가

parent 8290c382
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);
};
export { catchErrors } from "./catchErrors";
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