try/catch/else

Claude Pache claude.pache at gmail.com
Thu Feb 8 18:13:37 UTC 2018


What about the following pattern (labelled block + break)?

```js
processSuggestions: {
    let suggestions;
    try {
      suggestions = await fetchSuggestions();
    } catch (e) {
      alert('Failed to load suggestions');
      break processSuggestions;
    }
    showSuggestions(suggestions);
}
```

—Claude


More information about the es-discuss mailing list