2424
2525package com .auth0 .authentication .api ;
2626
27+ import com .auth0 .Auth0Exception ;
28+
2729import java .util .HashMap ;
2830import java .util .Map ;
2931
3032/**
3133 * Internal exception raised when a request to the API fails
3234 */
33- public class APIClientException extends RuntimeException {
35+ public class APIException extends Auth0Exception {
3436
3537 private int statusCode ;
3638
@@ -41,7 +43,7 @@ public class APIClientException extends RuntimeException {
4143 * @param detailMessage error message
4244 * @param throwable the cause of the exception
4345 */
44- public APIClientException (String detailMessage , Throwable throwable ) {
46+ public APIException (String detailMessage , Throwable throwable ) {
4547 super (detailMessage , throwable );
4648 this .statusCode = -1 ;
4749 this .responseError = new HashMap <>();
@@ -53,7 +55,7 @@ public APIClientException(String detailMessage, Throwable throwable) {
5355 * @param statusCode status code returned by the server
5456 * @param responseError payload of the error returned by the server
5557 */
56- public APIClientException (String detailMessage , int statusCode , Map <String , Object > responseError ) {
58+ public APIException (String detailMessage , int statusCode , Map <String , Object > responseError ) {
5759 super (detailMessage );
5860 this .statusCode = statusCode ;
5961 this .responseError = responseError != null ? responseError : new HashMap <String , Object >();
@@ -66,7 +68,7 @@ public APIClientException(String detailMessage, int statusCode, Map<String, Obje
6668 * @param statusCode status code returned by the server
6769 * @param responseError payload of the error returned by the server
6870 */
69- public APIClientException (String detailMessage , Throwable throwable , int statusCode , Map <String , Object > responseError ) {
71+ public APIException (String detailMessage , Throwable throwable , int statusCode , Map <String , Object > responseError ) {
7072 super (detailMessage , throwable );
7173 this .statusCode = statusCode ;
7274 this .responseError = responseError != null ? responseError : new HashMap <String , Object >();
0 commit comments