Exception: Calcpace::UnsupportedUnitError

Inherits:
Error
  • Object
show all
Defined in:
lib/calcpace/errors.rb

Overview

Raised when an unsupported unit or unit conversion is requested

Examples:

conversion pair

raise UnsupportedUnitError, :km_to_furlong

single unit, with the supported ones listed

raise UnsupportedUnitError.new(:furlong, supported: %i[km mi])

Instance Method Summary collapse

Constructor Details

#initialize(unit = nil, supported: nil) ⇒ UnsupportedUnitError

Returns a new instance of UnsupportedUnitError.



30
31
32
# File 'lib/calcpace/errors.rb', line 30

def initialize(unit = nil, supported: nil)
  super(build_message(unit, supported))
end