What does this log, and why doesn't the first then's error handler catch the error?
Promise.resolve("ok")
.then(
(value) => {
console.log("success:", value);
throw new Error("bad data");
},
(error) => console.log("first handler:", error.message),
)
.then(
() => console.log("never"),
(error) => console.log("second handler:", error.message),
)
.catch((error) => console.log("catch:", error.message));
The answer
Work out every line it logs, in order. Then check.
Checking your sign-in…