Pattern: Missing async
for promise function
Issue: -
Requires any function or method that returns a promise to be marked async
.
Rationale: Ensures that each function is only capable of
- returning a rejected promise, or
- throwing an Error object. In contrast, non-
async
Promise
-returning functions are technically capable of either.
This practice removes a requirement for consuming code to handle both cases.