3 ms·
> It takes a few more seconds to write but is incredibly easy to read and maintain. I disagree. try{ dothis(); /* ... 14 lines of dothis(
by throw_m239339 6y ago
> It takes a few more seconds to write but is incredibly easy to read and maintain.
I disagree.
try{
dothis();
/* ... 14 lines of dothis(); like */
catch(error){
log(error);
return responseCode(500);
}
sounds easier to both write and maintain to me. Only a handfull of times you'd ever want to deal with each exception separately. And when you do, it's not much more verbose than if err!=nil{ ... }.