fixing response error message for response type blob

This commit is contained in:
Warunee Tamkoo 2024-06-14 10:59:54 +07:00
parent 6375b446d2
commit a27091a81a
6 changed files with 157 additions and 139 deletions

View file

@ -411,48 +411,44 @@ export const useCounterMixin = defineStore("mixin", () => {
},
});
} else {
console.error(e.response.data); // ***
console.error(e.response.status); // ***
if (e.response.status == 404) {
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: msg,
icon: "warning",
color: "red",
onlycancel: true,
},
});
} else {
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`,
icon: "warning",
color: "red",
onlycancel: true,
},
});
}
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`,
icon: "warning",
color: "red",
onlycancel: true,
},
});
}
}
} else {
console.error(e.response.data); // ***
console.error(e.response.status); // ***
console.error("err===>", e); // ***
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`,
icon: "warning",
color: "red",
onlycancel: true,
},
});
if (e.message) {
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: e.message,
icon: "warning",
color: "red",
onlycancel: true,
},
});
} else {
q.dialog({
component: CustomComponent,
componentProps: {
title: `พบข้อผิดพลาด`,
message: `ข้อมูลผิดพลาดทำให้เกิดการไม่ตอบสนองต่อการเรียกใช้งานดูเว็บไซต์`,
icon: "warning",
color: "red",
onlycancel: true,
},
});
}
}
};