Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Don't subclass `Exception`. #1

Open
wants to merge 1 commit into from

1 participant

@myronmarston

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
Merged

Don't subclass `Exception`. #31

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Oct 5, 2012
  1. @myronmarston

    Don't subclass `Exception`.

    myronmarston authored
    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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  lib/raven/error.rb
View
2  lib/raven/error.rb
@@ -1,6 +1,6 @@
module Raven
- class Error < Exception
+ class Error < StandardError
end
end
Something went wrong with that request. Please try again.