Sha256: 380cd490149e31ab37922e6b5a8acfe9d01366601c39c59e962e7c0bb7fc3ecc

Contents?: true

Size: 909 Bytes

Versions: 4

Compression:

Stored size: 909 Bytes

Contents

module XeroGateway
  class ApiException < StandardError
    
    def initialize(type, message, xml)
      @type     = type
      @message  = message
      @xml      = xml
    end
    
    def message
      "#{@type}: #{@message} \n Generated by the following XML: \n #{@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 CreditNoteNotFoundError < StandardError; end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
xero_gateway-2.0.8 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.7 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.6 lib/xero_gateway/exceptions.rb
xero_gateway-2.0.5 lib/xero_gateway/exceptions.rb