profileRyan KesPGP keyI build stuffEmailGithubTwitterLast.fmMastodonMatrix

Catching Promise Errors

Syntax

new Promise((_, reject) => reject(new Error("Fail")))
  .then((value) => console.log("Handler 1"))
  .catch((reason) => {
    console.log("Caught failure " + reason)
    return "nothing"
  })
  .then((value) => console.log("Handler 2", value))

Related