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

You can use the await keyword multiple times, and therefore make it easier to handle the error with try catch:

      async someNetworkCall() {
        let unlock = await this.m.lock();

        try {
          const result = await doSomethingAsynchronous();
          // handle result
        } catch (exception) {
          // handle error
        }
        unlock();
      }



Join us for AI Startup School this June 16-17 in San Francisco!

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

Search: