Skip to content

Commit

Permalink
add better error messages for unhandled error cases
Browse files Browse the repository at this point in the history
  • Loading branch information
soumitradev committed Aug 7, 2023
1 parent f2875c1 commit a42655c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/pages/about.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const About = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/cmsExport.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const CMSExport = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};

Expand Down
6 changes: 3 additions & 3 deletions src/pages/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ const Edit = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
}, []);

Expand All @@ -400,7 +400,7 @@ const Edit = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
}, [id]);

Expand Down Expand Up @@ -691,7 +691,7 @@ const Edit = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};

Expand Down
2 changes: 1 addition & 1 deletion src/pages/finalize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ const Finalize = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};
const [userInfoCookie] = useCookies(["userInfo"]);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const Home = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};

Expand Down
4 changes: 2 additions & 2 deletions src/pages/view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ const View = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};

Expand Down Expand Up @@ -183,7 +183,7 @@ const View = () => {
} else if (res.status === 500) {
alert(`Server error: ${json.message}`);
} else {
alert(`Server error: ${json}`);
alert(`Server error: ${JSON.stringify(json)}`);
}
};

Expand Down

0 comments on commit a42655c

Please sign in to comment.