News for hackers. Stuff that matters.
Re:Lies we tell ourselves to keep using Golang by weatherlite on Sunday May 08, 2022 @08:55AM (#31303590)
> there's no way to tell _where_ the error will even come from - you might get a Net:: error, you might get a Timeout:: error, hell you could even get an Errno::! What most programmers wind up doing is handling no errors at all until they occur in runtime - or wrapping every single "suspicious" statement in a catch-all begin/rescue block, even when it's not needed.

Been programming Ruby for 8 years and have never seen anyone do that, so no... If that block of code can really throw so many different types of exceptions (usually - it can't) you can always catch StandardError.

There are no comments on this comment yet.