prefer-promise-reject-errors
Configuration
rslint.config.ts
Rule Details
Require using Error objects as Promise rejection reasons. When rejecting a Promise, it is best practice to reject with an Error object, because Error objects store a stack trace, making it much easier to debug by determining where the error came from. This rule reports calls to Promise.reject() and the reject parameter in new Promise((resolve, reject) => ...) when they are called with a non-Error value.
Examples of incorrect code for this rule:
Examples of correct code for this rule: