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

catchErrors 함수 추가

parent fef3942c
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