djberg96/net-ping — comment on commit 5f3249ac67be44657e9d5edd848cf543d0dbb9ab
File:  line 0
By paddor:

Okay, I see your point. But you kinda destroy the mechanism of exceptions. Unexpected exceptions are there to be raised, not to be stored in an attribute that has to be inquired. So one would have to remember to call that method just to know if there was an exception. Yeah, the purpose is to report success or failure, but do you know what other exception classes inherit from Exception?

* NoMemoryError
* ScriptError (LoadError, NotImplementedError, SyntaxError)
* SystemExit (raised by Kernel#exit)
* SecurityError ($SAFE related stuff)
* SignalException (Interrupt, raised by pressing Ctrl+C)
* SystemStackError (used for stack overflows)

Don't you think it's a bit too much catch all these? These exceptions are used for severe cases.

You should just rescue StandardError (by writing "rescue" or "rescue StandardError").

Regards,
Patrik