diff options
| author | Jack Nagel | 2014-09-12 21:19:25 -0500 |
|---|---|---|
| committer | Jack Nagel | 2014-09-12 21:24:56 -0500 |
| commit | 1ace6f147df05b47034c33f65370c50903bcd2d2 (patch) | |
| tree | 1a8cc6343918dfc53599506fb1c85d61ca1ce232 | |
| parent | ddeac0284bb25bba69d2b9cf4f69c63de7a49dc5 (diff) | |
| download | brew-1ace6f147df05b47034c33f65370c50903bcd2d2.tar.bz2 | |
Make exception subclasses use their superclass properly
| -rw-r--r-- | Library/Homebrew/exceptions.rb | 17 |
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 |
