Sha256: dff1e0f46b22ed7d22c79e50e25c22a73a85e5f0231f5c69d449e5119f513008

Contents?: true

Size: 991 Bytes

Versions: 126

Compression:

Stored size: 991 Bytes

Contents

module ChargeBee

  class Error < StandardError
    attr_reader :original_error

    def initialize(message=nil,original_error = nil)
        super message
        @original_error = original_error
    end
  end

  class IOError < Error; end

  class APIError < Error

    attr_reader  :http_status_code, :type, :api_error_code, :param, :json_obj,
                 #Deprecated attributes
                 :http_code, :http_body, :error_code
    
    def initialize(http_code=nil, json_obj = nil)
      super json_obj[:message]
      @json_obj = json_obj
      @http_status_code = http_code
      @type = json_obj[:type]
      @api_error_code = json_obj[:api_error_code]
      @param = json_obj[:param]

      #Deprecated attributes
      @error_code = json_obj[:error_code]
      @http_code = http_code
      @http_body = json_obj.to_s
    end
    
  end


  class OperationFailedError < APIError; end

  class InvalidRequestError < APIError;  end

  class PaymentError < APIError;  end

end

Version data entries

126 entries across 126 versions & 1 rubygems

Version Path
chargebee-2.47.1 lib/chargebee/errors.rb
chargebee-2.47.0 lib/chargebee/errors.rb
chargebee-2.47.0.beta.1 lib/chargebee/errors.rb
chargebee-2.46.0 lib/chargebee/errors.rb
chargebee-2.45.0 lib/chargebee/errors.rb
chargebee-2.44.1 lib/chargebee/errors.rb
chargebee-2.44.0 lib/chargebee/errors.rb
chargebee-2.43.0 lib/chargebee/errors.rb
chargebee-2.42.0 lib/chargebee/errors.rb
chargebee-2.41.0 lib/chargebee/errors.rb
chargebee-2.40.0 lib/chargebee/errors.rb
chargebee-2.38.1 lib/chargebee/errors.rb
chargebee-2.38.0 lib/chargebee/errors.rb
chargebee-2.37.1 lib/chargebee/errors.rb
chargebee-2.37.0 lib/chargebee/errors.rb
chargebee-2.36.2 lib/chargebee/errors.rb
chargebee-2.36.1 lib/chargebee/errors.rb
chargebee-2.36.0 lib/chargebee/errors.rb
chargebee-2.35.0 lib/chargebee/errors.rb
chargebee-2.34.0 lib/chargebee/errors.rb