aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Nagel2014-09-12 21:19:25 -0500
committerJack Nagel2014-09-12 21:24:56 -0500
commitfbc623376636c7211628d49ff5270dbf9a691547 (patch)
treeb9757dfa03eb5c0d6359a47a6c8ff7d3da26b4d5
parentfc8d3464e4b464bcc8cf1c1988492f317026d79b (diff)
downloadhomebrew-fbc623376636c7211628d49ff5270dbf9a691547.tar.bz2
Make exception subclasses use their superclass properly
-rw-r--r--Library/Homebrew/exceptions.rb17
1 files changed, 4 insertions, 13 deletions
diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb
index b9696f623..a45a5de77 100644
--- a/Library/Homebrew/exceptions.rb
+++ b/Library/Homebrew/exceptions.rb
@@ -251,22 +251,13 @@ class ChecksumMismatchError < RuntimeError
end
class ResourceMissingError < ArgumentError
- def initialize formula, resource
- @formula = formula
- @resource = resource
- end
-
- def to_s
- "Formula #{@formula} does not define resource \"#{@resource}\"."
+ def initialize(formula, resource)
+ super "#{formula} does not define resource #{resource.inspect}"
end
end
class DuplicateResourceError < ArgumentError
- def initialize resource
- @resource = resource
- end
-
- def to_s
- "Resource \"#{@resource}\" defined more than once."
+ def initialize(resource)
+ super "Resource #{resource.inspect} is defined more than once"
end
end