Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Don't subclass `Exception`. #1

Open
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant

Most errors should subclass StandardError. A bare rescue will not
catch Exception-subclassed errors; that's be design because Exception-subclassed errors are intended for situations like signals (e.g. when
a user halts a script with "ctrl-c") or fatal situations like
out-of-memory.

See http://www.codeotaku.com/blog/2009-08/ruby-standard-error/index for
more info on the design of Ruby's exception hierarchy.

@myronmarston myronmarston Don't subclass `Exception`.
Most errors should subclass `StandardError`.  A bare rescue will not
catch `Exception`-subclassed errors; that's be design because `Exception`-subclassed errors are intended for situations like signals (e.g. when
a user halts a script with "ctrl-c") or fatal situations like
out-of-memory.

See http://www.codeotaku.com/blog/2009-08/ruby-standard-error/index for
more info on the design of Ruby's exception hierarchy.
2a8f37f

@myronmarston myronmarston referenced this pull request in getsentry/raven-ruby Oct 12, 2012

Merged

Don't subclass `Exception`. #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment