Skip to content

Commit 94365cf

Browse files
committed
feat: deserialize alternative format errors
1 parent 4509c3a commit 94365cf

24 files changed

+252
-117
lines changed
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class BadRequestError extends APIException {
@@ -14,7 +12,7 @@ public class BadRequestError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public BadRequestError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public BadRequestError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class ForbiddenError extends APIException {
@@ -14,7 +12,7 @@ public class ForbiddenError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public ForbiddenError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public ForbiddenError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class GatewayTimeoutError extends APIException {
@@ -14,7 +12,7 @@ public class GatewayTimeoutError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public GatewayTimeoutError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public GatewayTimeoutError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class InternalServerError extends APIException {
@@ -14,7 +12,7 @@ public class InternalServerError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public InternalServerError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public InternalServerError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class InvalidRequestError extends APIException {
@@ -14,7 +12,7 @@ public class InvalidRequestError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public InvalidRequestError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public InvalidRequestError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class MethodNotAllowedError extends APIException {
@@ -14,7 +12,7 @@ public class MethodNotAllowedError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public MethodNotAllowedError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public MethodNotAllowedError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class NotFoundError extends APIException {
@@ -14,7 +12,7 @@ public class NotFoundError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public NotFoundError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public NotFoundError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class PaymentError extends APIException {
@@ -14,7 +12,7 @@ public class PaymentError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public PaymentError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public PaymentError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class RateLimitError extends APIException {
@@ -14,7 +12,7 @@ public class RateLimitError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public RateLimitError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public RateLimitError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.easypost.exception.API;
22

3-
import java.util.List;
4-
5-
import com.easypost.model.Error;
3+
import com.easypost.model.FieldErrorOrStringList;
64
import com.easypost.exception.APIException;
75

86
public class RedirectError extends APIException {
@@ -14,7 +12,7 @@ public class RedirectError extends APIException {
1412
* @param statusCode the exception status code
1513
* @param errors the errors array
1614
*/
17-
public RedirectError(final String message, final String code, final int statusCode, List<Error> errors) {
15+
public RedirectError(final String message, final String code, final int statusCode, FieldErrorOrStringList errors) {
1816
super(message, code, statusCode, errors);
1917
}
2018
}

0 commit comments

Comments
 (0)