Skip to content

Commit

Permalink
🎨 Distinguish tag not found error
Browse files Browse the repository at this point in the history
  • Loading branch information
nwingt authored and williamchong committed Jan 24, 2025
1 parent 4621a57 commit b919714
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/server/api/routes/bookstore/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,10 @@ router.get('/bookstore/products', async (req, res, next) => {

res.json(result);
} catch (error) {
if (error.response?.status === 422) {
if (
error.response?.status === 422 &&
error.response?.data?.error?.type === 'VIEW_NAME_NOT_FOUND'
) {
res.status(404).send('TAG_NOT_FOUND');
return;
}
Expand Down

0 comments on commit b919714

Please sign in to comment.