Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit 65dcab7

Browse files
committed
fix(code-review): use try/catch
1 parent 4641a53 commit 65dcab7

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/alexjs/alex.handler.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ export class AlexHandler {
6767
targetNotification.notificationId,
6868
);
6969
if (notificationMessage && notificationMessage.deletable) {
70-
await notificationMessage.delete().catch(console.error);
70+
try {
71+
await notificationMessage.delete()
72+
} catch (error) {
73+
console.error(error)
74+
}
7175

7276
this.savedNotifications = this.savedNotifications.filter(
7377
(el) =>
@@ -113,7 +117,11 @@ export class AlexHandler {
113117
);
114118

115119
if (notificationMessage && notificationMessage.deletable) {
116-
await notificationMessage.delete().catch(console.error);
120+
try {
121+
await notificationMessage.delete()
122+
} catch (error) {
123+
console.error(error)
124+
}
117125
}
118126
}
119127

0 commit comments

Comments
 (0)