Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on You’re better off using Exceptions. Parent comment
That's JavaScript, right? That's probably not the best language to use to judge the concept of exceptions.
It's cleaner in languages like Java:
try { Record record = store.findRecord(params.id); render(record); } catch(RecordNotFoundException e) { render('record-not-found'); } catch (Exception e) { render('unexpected-error'); }
There are no comments on this comment yet.
That's JavaScript, right? That's probably not the best language to use to judge the concept of exceptions.
It's cleaner in languages like Java: