Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

IMO when you do control-flow in catch blocks, you're fighting against the language. You lose Typescripts type-safety, and the whole "if e instanceof ... else throw e"-dance creates too much boilerplate.

If the config file not existing is a handleable case, then write a "loadConfig" function that returns undefined.



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

Search: