Sha256: 3afc6cd6dad01e446c78c8d5124582773bdd01da91a6ae180bbcedcca8c07649

Contents?: true

Size: 459 Bytes

Versions: 4

Compression:

Stored size: 459 Bytes

Contents

module Xhash
  class Error < StandardError
    attr_reader :message, :response

    def initialize(options = {})
      if options.is_a? Hash
        @message = options[:message]
        @response = options[:response]
      else
        @message = "Server error"
        @response = options
      end

      super
    end
  end

  class MissingRequiredFieldError < Error; end

  class InvalidFieldError < Error; end

  class MalformedResponse < Error; end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xhash_client-0.3.8 lib/xhash/error.rb
xhash_client-0.3.7 lib/xhash/error.rb
xhash_client-0.3.6 lib/xhash/error.rb
xhash_client-0.3.5 lib/xhash/error.rb