Skip to content

Commit 3ecfe1b

Browse files
committed
Fixed NZ Payroll exceptions
1 parent 2e8e22d commit 3ecfe1b

4 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/main/java/com/xero/api/XeroApiExceptionHandler.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ public void validationError(Integer statusCode, String objectType, com.xero.mode
4949
}
5050

5151
// PAYROLL NZ Validation Errors
52-
public void validationError(Integer statusCode, String objectType, com.xero.models.payrollnz.Problem error) {
52+
public void validationError(Integer statusCode, String objectType, com.xero.models.payrollnz.Problem error, Exception e) {
5353
if (statusCode == 400 ) {
54-
throw new XeroBadRequestException(objectType, error);
54+
throw new XeroBadRequestException(objectType, error, e);
5555
} else if(statusCode == 405) {
56-
throw new XeroMethodNotAllowedException(objectType, error);
56+
throw new XeroMethodNotAllowedException(objectType, error, e);
5757
} else if(statusCode == 409) {
58-
throw new XeroConflictException(objectType, error);
58+
throw new XeroConflictException(objectType, error, e);
5959
}
6060
}
6161

src/main/java/com/xero/api/XeroBadRequestException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ public XeroBadRequestException(String objectType, com.xero.models.payrolluk.Prob
7070
this.payrollUkProblem = problem;
7171
}
7272

73-
public XeroBadRequestException(String objectType, com.xero.models.payrollnz.Problem problem) {
73+
public XeroBadRequestException(String objectType, com.xero.models.payrollnz.Problem problem, Exception e) {
74+
super(e);
7475
this.statusCode = 400;
7576
this.type = objectType;
7677
this.payrollNzProblem = problem;

src/main/java/com/xero/api/XeroConflictException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ public XeroConflictException(String objectType, com.xero.models.payrolluk.Proble
5858
this.payrollUkProblem = problem;
5959
}
6060

61-
public XeroConflictException(String objectType, com.xero.models.payrollnz.Problem problem) {
61+
public XeroConflictException(String objectType, com.xero.models.payrollnz.Problem problem, Exception e) {
62+
super(e);
6263
this.statusCode = 409;
6364
this.type = objectType;
6465
this.payrollNzProblem = problem;

src/main/java/com/xero/api/XeroMethodNotAllowedException.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public XeroMethodNotAllowedException(String objectType, com.xero.models.payrollu
5959
this.payrollUkProblem = problem;
6060
}
6161

62-
public XeroMethodNotAllowedException(String objectType, com.xero.models.payrollnz.Problem problem) {
62+
public XeroMethodNotAllowedException(String objectType, com.xero.models.payrollnz.Problem problem, Exception e) {
63+
super(e);
6364
this.statusCode = 405;
6465
this.type = objectType;
6566
this.payrollNzProblem = problem;

0 commit comments

Comments
 (0)