handleError fix
parent
c4ae08f558
commit
5536cddf1b
|
@ -9,13 +9,17 @@ const useApi = () => {
|
|||
|
||||
const handleError = err => {
|
||||
let message;
|
||||
switch (err.response?.status) {
|
||||
switch (err?.status) {
|
||||
case 500:
|
||||
message = err.response.statusText;
|
||||
message = `${err.title} ${err.correlationId}`;
|
||||
break;
|
||||
|
||||
case 404:
|
||||
message = err.message;
|
||||
break;
|
||||
|
||||
default:
|
||||
message = err.message;
|
||||
message = `${err.title} ${err.correlationId}`;
|
||||
}
|
||||
|
||||
error(message);
|
||||
|
|
Loading…
Reference in New Issue