Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/main/java/com/xero/api/XeroApiExceptionHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,20 @@ public void validationError(Integer statusCode, String objectType, com.xero.mode
throw new XeroMethodNotAllowedException(objectType, error, e);
}
}

/** Handle Validation Errors (400)
* @param statusCode Integer the server status code returned.
* @param objectType String object type being interacted with when the error was returned.
* @param error Problem object with details specific to UK Payroll API
* @param e Exception object with details about the original exception
*/
public void validationError(Integer statusCode, String objectType, com.xero.models.payrollauv2.Problem error, Exception e) {
if (statusCode == 400 ) {
throw new XeroBadRequestException(objectType, error, e);
} else if(statusCode == 405) {
throw new XeroMethodNotAllowedException(objectType, error, e);
}
}

/** Handle Validation Errors (400)
* @param statusCode Integer the server status code returned.
Expand Down
Loading