Sha256: 152d49a9f3c11dbd7f6d6e79e9571dad63cf34b4384100cafe53528954a410c2

Contents?: true

Size: 1.28 KB

Versions: 12

Compression:

Stored size: 1.28 KB

Contents

module XeroGateway
  class NoGatewayError < StandardError; end
  class AccountsListNotLoadedError < StandardError; end
  class InvalidLineItemError < StandardError; end

  class ApiException < StandardError
    
    def initialize(type, message, request_xml, response_xml)
      @type     = type
      @message  = message
      @request_xml      = request_xml
      @response_xml      = response_xml
    end
    
    attr_reader :request_xml, :response_xml
    
    def message
      "#{@type}: #{@message} \n Generated by the following XML: \n #{@response_xml}"
    end
    
  end
  
  class UnparseableResponse < StandardError
    
    def initialize(root_element_name)
      @root_element_name = root_element_name
    end
    
    def message
      "A root element of #{@root_element_name} was returned, and we don't understand that!"
    end
      
  end
  
  class ObjectNotFound < StandardError
    
    def initialize(api_endpoint)
      @api_endpoint = api_endpoint
    end
    
    def message
      "Couldn't find object for API Endpoint #{@api_endpoint}"
    end
    
  end
  
  class InvoiceNotFoundError < StandardError; end
  class BankTransactionNotFoundError < StandardError; end
  class CreditNoteNotFoundError < StandardError; end
  class ManualJournalNotFoundError < StandardError; end
end

Version data entries

12 entries across 12 versions & 3 rubygems

Version Path
xero_gateway-float-2.1.7 lib/xero_gateway/exceptions.rb
xero_gateway-float-2.1.6 lib/xero_gateway/exceptions.rb
xero_gateway-float-2.1.4 lib/xero_gateway/exceptions.rb
xero_gateway-float-2.1.3 lib/xero_gateway/exceptions.rb
xero_gateway-float-2.1.1 lib/xero_gateway/exceptions.rb
xero_gateway-2.1.0 lib/xero_gateway/exceptions.rb
xero_gateway-n8vision-2.0.20 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.19 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.18 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.17 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.16 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.15 lib/xero_gateway/exceptions.rb