This rule aims to ensure that Promises are only rejected with Error objects.
It is considered good practice to only pass instances of the built-in Error object to the reject() function for user-defined errors in Promises. Error objects automatically store a stack trace, which can be used to debug an error by determining where it came from. If a Promise is rejected with a non-Error value, it can be difficult to determine where the rejection occurred.
http://eslint.org/docs/rules/prefer-promise-reject-errors
Rule:
prefer-promise-reject-errors: "error"
This rule aims to ensure that Promises are only rejected with
Errorobjects.It is considered good practice to only pass instances of the built-in
Errorobject to thereject()function for user-defined errors in Promises.Errorobjects automatically store a stack trace, which can be used to debug an error by determining where it came from. If a Promise is rejected with a non-Errorvalue, it can be difficult to determine where the rejection occurred.http://eslint.org/docs/rules/prefer-promise-reject-errors
Rule: