lib/haveapi/client/exceptions.rb in haveapi-client-0.20.0 vs lib/haveapi/client/exceptions.rb in haveapi-client-0.21.0

- old
+ new

@@ -1,28 +1,24 @@ module HaveAPI::Client - class ProtocolError < StandardError ; end + class ProtocolError < StandardError; end class ActionFailed < StandardError attr_reader :response def initialize(response) + super("#{response.action.name} failed: #{response.message}") + @response = response end - - def message - "#{@response.action.name} failed: #{@response.message}" - end end class ValidationError < ActionFailed attr_reader :errors def initialize(action, errors) + super("#{action.name} failed: input parameters not valid") + @action = action @errors = errors - end - - def message - "#{@action.name} failed: input parameters not valid" end end end