Sha256: 60172e38e6f5e38e710fedf95f08cbbba2b662b878b7257c8293b17671682bf1

Contents?: true

Size: 584 Bytes

Versions: 8

Compression:

Stored size: 584 Bytes

Contents

# frozen_string_literal: true

module FulfilApi
  # The {FulfilApi::Error} is the base class for all FulfilApi errors, also used
  #   for generic or unexpected errors.
  class Error < StandardError
    attr_reader :details

    # @param message [String] The displayable error message for the receiver.
    # @param details [Hash] Any additional details exposed by the issuer of the exception.
    def initialize(message, details: nil)
      @details = details
      super(message)
    end

    # @return [String]
    def message
      "[FulfilApi::Error] #{super}"
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
fulfil_api-0.1.4 lib/fulfil_api/error.rb
fulfil_api-0.1.3 lib/fulfil_api/error.rb
fulfil_api-0.1.2 lib/fulfil_api/error.rb
fulfil_api-0.1.1 lib/fulfil_api/error.rb
fulfil_api-0.1.0 lib/fulfil_api/error.rb
fulfil_api-0.0.3 lib/fulfil_api/error.rb
fulfil_api-0.0.2 lib/fulfil_api/error.rb
fulfil_api-0.0.1 lib/fulfil_api/error.rb