-
-
Notifications
You must be signed in to change notification settings - Fork 95
Open
Labels
Description
I would like to suggest a rule to prevent calling the promise catch
method without any argument. It works "differently" than the catch
block and it might lead to bugs when one expects the rejection to be ignored.
Demonstration
async function iReject() {
throw 'foobar';
}
(async () => {
try {
await iReject();
} catch {
// fine
}
// fine
await iReject().catch(() => {});
// throws
await iReject().catch();
})();
dasa and mickdekkers