Skip to content

Commit

Permalink
chore: minor change on error handling logic and messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan-Kuan committed Jan 21, 2025
1 parent 75d8df1 commit 9c8b88f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
})
.then(() => true)
.catch(async err => {
console.error(`Error desc: "${err.response.description}"`)
switch (err.response.description) {
case 'Forbidden: bot was blocked by the user':
await user.setBlockedBot(user_id);
Expand All @@ -61,10 +60,11 @@ export default async function handler(req: VercelRequest, res: VercelResponse) {
await user.unsubscribe(user_id);
break;
default:
console.error(`Error occurred when sending a photo to '${user_id}'.`);
console.error(`Error occurred while pushing to user: '${user_id}'.`);
console.error(err);
return false;
}
return false;
return true;
})
);
}
Expand Down

0 comments on commit 9c8b88f

Please # to comment.