Similar to catch-or-return, we want to make sure that any
this.someTask.perform()
calls have either a .catch(...)
attached to it, they
are returned from a function, or they are used with yield
or await
.
The reason for this is that without explicit error handling on the perform()
calls you will up with "Unhandled promise error" issues if you use error
reporting services like Sentry.
This rule forbids the following:
this.submitTask.perform();
This rule allows the following:
this.submitTask.perform().catch(error => { ... });
try {
await this.submitTask.perform();
} catch (error) {
...
}
return this.submitTask.perform();