Permalink
Browse files

Inherit from StandardError instead of Exception

Exceptions that inherit from StandardError deal with application level
errors, while if you inherit Exception directly you risk catching errors
to do with the environment. Also the convention is to end your exceptions
with the word Error rather than Exception.
  • Loading branch information...
1 parent 2a50ef6 commit ea6ca672c52812234e380e60962e8b2b0c68d77f @beerlington beerlington committed Feb 17, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/classy_enum/base.rb
View
2 lib/classy_enum/base.rb
@@ -1,5 +1,5 @@
module ClassyEnum
- class SubclassNameError < Exception; end
+ class SubclassNameError < StandardError; end
class Base
include Comparable

0 comments on commit ea6ca67

Please sign in to comment.