Skip to content

Commit

Permalink
🥅 (all) Display more info on errors
Browse files Browse the repository at this point in the history
Related to #7
  • Loading branch information
Eliott Coyac committed Feb 19, 2021
1 parent 4438172 commit 449c5d1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions admin-app/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function handleError(err: Error | AxiosError | string) {
store.commit("error", err);
} else if (isAxiosError(err) && err.response?.data?.message) {
store.commit("error", err.response.data.message);
console.error(err.response.data);
} else if (isError(err)) {
store.commit("error", err.message);
} else {
Expand Down
2 changes: 1 addition & 1 deletion api-node/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async function listen(port = env.listen.port.api) {
ctx.body = { message: err.message };
} else {
ctx.status = 500;
ctx.body = { message: "Internal error" };
ctx.body = { message: "Internal error: " + err.message, stack: err.stack };
}

try {
Expand Down
2 changes: 1 addition & 1 deletion game-server/app/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.use(async (ctx, next) => {
ctx.body = { message: err.message };
} else {
ctx.status = 500;
ctx.body = { message: "Internal error" };
ctx.body = { message: "Internal error: " + err.message, stack: err.stack };
}

await ApiError.create({
Expand Down
1 change: 1 addition & 0 deletions webapp-vue/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export function handleError(err: Error | AxiosError | string) {
store.commit("error", err);
} else if (isAxiosError(err) && err.response?.data?.message) {
store.commit("error", err.response.data.message);
console.error(err.response.data);
} else if (isError(err)) {
store.commit("error", err.message);
} else {
Expand Down

0 comments on commit 449c5d1

Please sign in to comment.