Improving Axios error logging

This commit is contained in:
David Négrier 2021-12-03 20:55:46 +01:00
parent f90bd85ded
commit 8b21ba5383

View File

@ -89,7 +89,7 @@ export class ErrorScene extends Phaser.Scene {
} else if (Axios.isAxiosError(error) && error.response) { } else if (Axios.isAxiosError(error) && error.response) {
// Axios HTTP error // Axios HTTP error
// client received an error response (5xx, 4xx) // client received an error response (5xx, 4xx)
console.error("Axios error", error.toJSON()); console.error("Axios error. Request:", error.request, " - Response: ", error.response);
scene.start(ErrorSceneName, { scene.start(ErrorSceneName, {
title: title:
"HTTP " + "HTTP " +
@ -102,7 +102,7 @@ export class ErrorScene extends Phaser.Scene {
} else if (Axios.isAxiosError(error)) { } else if (Axios.isAxiosError(error)) {
// Axios HTTP error // Axios HTTP error
// client never received a response, or request never left // client never received a response, or request never left
console.error("Axios error", error.toJSON()); console.error("Axios error. No full HTTP response received. Request:", error.request);
scene.start(ErrorSceneName, { scene.start(ErrorSceneName, {
title: "Network error", title: "Network error",
subTitle: error.message, subTitle: error.message,