Hacker News new | past | comments | ask | show | jobs | submit login

Yes, but this has a natural analogue in promise land:

    function startTask() {
      const promise = doTask();
      promise.catch((e) => {
        if (e instanceof SpecificErrorType) {
          handler(e);
        } else {
          throw e;
        }
      });
    }



The difference is the default behaviour: whether errors are fatal or whether they are ignored by default.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: