Exception: SimpleShipping::ValidationError
- Defined in:
- lib/simple_shipping/exceptions.rb
Overview
Raises when some data is invalid or missing to build a request.
Instance Method Summary collapse
-
#initialize(model_or_msg) ⇒ ValidationError
constructor
A new instance of ValidationError.
Constructor Details
#initialize(model_or_msg) ⇒ ValidationError
Returns a new instance of ValidationError.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/simple_shipping/exceptions.rb', line 11 def initialize(model_or_msg) @message = case model_or_msg when Abstract::Model "Invalid model #{model_or_msg.class}. Validation errors: #{model_or_msg.errors..join(', ')}" when String model_or_msg end super(@message) end |