Sha256: 22dce67a5c86cba9b420d1894822c1a07eb4e673143abb8ddf1dca690d50220f

Contents?: true

Size: 537 Bytes

Versions: 33

Compression:

Stored size: 537 Bytes

Contents

module HaveAPI::Client
  class ProtocolError < StandardError ; end

  class ActionFailed < StandardError
    attr_reader :response

    def initialize(response)
      @response = response
    end

    def message
      "#{@response.action.name} failed: #{@response.message}"
    end
  end

  class ValidationError < ActionFailed
    attr_reader :errors

    def initialize(action, errors)
      @action = action
      @errors = errors
    end

    def message
      "#{@action.name} failed: input parameters not valid"
    end
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
haveapi-client-0.20.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.19.3 lib/haveapi/client/exceptions.rb
haveapi-client-0.19.2 lib/haveapi/client/exceptions.rb
haveapi-client-0.19.1 lib/haveapi/client/exceptions.rb
haveapi-client-0.19.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.18.2 lib/haveapi/client/exceptions.rb
haveapi-client-0.18.1 lib/haveapi/client/exceptions.rb
haveapi-client-0.18.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.17.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.16.3 lib/haveapi/client/exceptions.rb
haveapi-client-0.16.2 lib/haveapi/client/exceptions.rb
haveapi-client-0.16.1 lib/haveapi/client/exceptions.rb
haveapi-client-0.16.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.15.1 lib/haveapi/client/exceptions.rb
haveapi-client-0.15.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.14.2 lib/haveapi/client/exceptions.rb
haveapi-client-0.14.1 lib/haveapi/client/exceptions.rb
haveapi-client-0.14.0 lib/haveapi/client/exceptions.rb
haveapi-client-0.13.3 lib/haveapi/client/exceptions.rb
haveapi-client-0.13.2 lib/haveapi/client/exceptions.rb