Package com.xero.api

Class XeroApiExceptionHandler


  • public class XeroApiExceptionHandler
    extends Object
    XeroApiExceptionHandler main method for handling and throwing errors returned by Xero API
    • Constructor Detail

      • XeroApiExceptionHandler

        public XeroApiExceptionHandler()
        Init Xero Api Exception Hander
    • Method Detail

      • validationError

        public void validationError​(String objectType,
                                    Error error,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        error - Error object with details specific to Accounting API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    Error error,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        error - Error object with details specific to Assets API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    Statements error,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        error - Statements object with details specific to Bank Feeds API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    FeedConnections error,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        error - FeedConnections object with details specific to Bank Feeds API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(Integer statusCode,
                                    String objectType,
                                    Problem error,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        statusCode - Integer the server status code returned.
        objectType - String object type being interacted with when the error was returned.
        error - Problem object with details specific to UK Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(Integer statusCode,
                                    String objectType,
                                    Problem error,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        statusCode - Integer the server status code returned.
        objectType - String object type being interacted with when the error was returned.
        error - Problem object with details specific to NZ Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    Employees employees,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        employees - Employees object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    LeaveApplications leaveApplications,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        leaveApplications - LeaveApplications object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    PayItems payItems,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        payItems - PayItems object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    PayRuns payRuns,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        payRuns - PayRuns object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    PayrollCalendars payrollCalendars,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        payrollCalendars - PayrollCalendars object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    SuperFunds superFunds,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        superFunds - SuperFunds object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    Timesheets timesheets,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        timesheets - Timesheets object with details specific to AU Payroll API
        e - Exception object with details about the original exception
      • validationError

        public void validationError​(String objectType,
                                    String msg,
                                    Exception e)
        Handle Validation Errors (400)
        Parameters:
        objectType - String object type being interacted with when the error was returned.
        msg - Sting with details specific to Accounting API
        e - Exception object with details about the original exception
      • execute

        public void execute​(com.google.api.client.http.HttpResponseException e)
        GENERIC ERROR HANDLER
        Parameters:
        e - HttpResponseException object with details about the original exception
      • execute

        public void execute​(com.google.api.client.http.HttpResponseException e,
                            ApiClient apiClient)
                     throws com.fasterxml.jackson.core.JsonParseException,
                            com.fasterxml.jackson.databind.JsonMappingException,
                            IOException
        LEGACY ERROR HANDLER
        Parameters:
        e - HttpResponseException object with details about the original exception
        apiClient - ApiClient class for use in deserializing http response
        Throws:
        com.fasterxml.jackson.core.JsonParseException - for parsing errors
        com.fasterxml.jackson.databind.JsonMappingException - for mapping errors
        IOException - for failed or interrupted I/O operations