How can I apply logic in case a set of Promises are rejected (all of them)?
validUserIdPromise = checkValidUserId(id)
.then(() => console.log("user id")
.catch(() => console.log("not user id")
validCarIdPromise = checkValidCarId(id)
.then(() => console.log("car id")
.catch(() => console.log("not car id");
// TODO how to call this? console.log("neither user nor car");
To broaden my question: is it recommended to use Promise.reject() for normal flow control of a JavaScript app, or rather use it only when something goes wrong?
Use case: my nodeJs app receives a uuid from a client, and responds based on matching resource (user or car in the example).