I am writing a code that heavily uses ECMAScript 6-like promises in Javascript.
I cannot decide, if it's more "correct" to reject promise with a string or with an error, since I have seen both of these patterns being used.
That is, if it's better to call
return new Promise(response, reject) {
reject("Sky is falling.");
}
or
return new Promise(response, reject) {
reject(new Error("Sky is falling."));
}