// Path: src/main/java/com/hyperwallet/clientsdk/model/HyperwalletError.java
// @XmlRootElement
// public class HyperwalletError {
// 
//     private String code;
//     private String fieldName;
//     private String message;
//     private List<String> relatedResources;
// 
//     public HyperwalletError() {
//     }
// 
//     public HyperwalletError(String code, String message) {
//         this.code = code;
//         this.message = message;
//     }
// 
//     public HyperwalletError(String code, String fieldName, String message) {
//         this.code = code;
//         this.fieldName = fieldName;
//         this.message = message;
//     }
// 
//     public HyperwalletError(String code, String fieldName, String message, List<String> relatedResources) {
//         this.code = code;
//         this.fieldName = fieldName;
//         this.message = message;
//         this.relatedResources = relatedResources;
//     }
// 
//     public String getCode() {
//         return code;
//     }
// 
//     public String getFieldName() {
//         return fieldName;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public List<String> getRelatedResources() {
//         return relatedResources;
//     }
// }
// 
// Path: src/main/java/com/hyperwallet/clientsdk/model/HyperwalletErrorList.java
// @XmlRootElement
// public class HyperwalletErrorList {
// 
//     public List<HyperwalletError> errors = new ArrayList<HyperwalletError>();
// 
//     public HyperwalletErrorList() {
//     }
// 
//     public List<HyperwalletError> getErrors() {
//         return errors;
//     }
// 
//     public void setErrors(List<HyperwalletError> errors) {
//         this.errors = errors;
//     }
// }


import cc.protea.util.http.Response;
import com.hyperwallet.clientsdk.model.HyperwalletError;
import com.hyperwallet.clientsdk.model.HyperwalletErrorList;
import java.util.List;
package com.hyperwallet.clientsdk;



public class HyperwalletException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Response response = null;
    private String errorMessage;
    private String errorCode;
    private List<String> relatedResources;
    private HyperwalletErrorList hyperwalletErrorList;

    public HyperwalletException(final Exception e) {
        super(e);
    }

    public HyperwalletException(final Response response, final int code, final String message) {
        super(message);

        this.response = response;
        errorCode = Integer.toString(code);
        errorMessage = message;
    }

    public HyperwalletException(final Response response, final int code, final String message, final Exception e) {
        super(e);

        this.response = response;
        errorCode = Integer.toString(code);
        errorMessage = message;
    }

    public HyperwalletException(final Response response, final HyperwalletErrorList hyperwalletErrorList) {
        super(hyperwalletErrorList.getErrors().get(0).getMessage());

        this.response = response;
        this.hyperwalletErrorList = hyperwalletErrorList;
// Path: src/main/java/com/hyperwallet/clientsdk/model/HyperwalletError.java
// @XmlRootElement
// public class HyperwalletError {
// 
//     private String code;
//     private String fieldName;
//     private String message;
//     private List<String> relatedResources;
// 
//     public HyperwalletError() {
//     }
// 
//     public HyperwalletError(String code, String message) {
//         this.code = code;
//         this.message = message;
//     }
// 
//     public HyperwalletError(String code, String fieldName, String message) {
//         this.code = code;
//         this.fieldName = fieldName;
//         this.message = message;
//     }
// 
//     public HyperwalletError(String code, String fieldName, String message, List<String> relatedResources) {
//         this.code = code;
//         this.fieldName = fieldName;
//         this.message = message;
//         this.relatedResources = relatedResources;
//     }
// 
//     public String getCode() {
//         return code;
//     }
// 
//     public String getFieldName() {
//         return fieldName;
//     }
// 
//     public String getMessage() {
//         return message;
//     }
// 
//     public List<String> getRelatedResources() {
//         return relatedResources;
//     }
// }
// 
// Path: src/main/java/com/hyperwallet/clientsdk/model/HyperwalletErrorList.java
// @XmlRootElement
// public class HyperwalletErrorList {
// 
//     public List<HyperwalletError> errors = new ArrayList<HyperwalletError>();
// 
//     public HyperwalletErrorList() {
//     }
// 
//     public List<HyperwalletError> getErrors() {
//         return errors;
//     }
// 
//     public void setErrors(List<HyperwalletError> errors) {
//         this.errors = errors;
//     }
// }


// Path: src/main/java/com/hyperwallet/clientsdk/HyperwalletException.java
import cc.protea.util.http.Response;
import com.hyperwallet.clientsdk.model.HyperwalletError;
import com.hyperwallet.clientsdk.model.HyperwalletErrorList;
import java.util.List;

package com.hyperwallet.clientsdk;



public class HyperwalletException extends RuntimeException {

    private static final long serialVersionUID = 1L;

    private Response response = null;
    private String errorMessage;
    private String errorCode;
    private List<String> relatedResources;
    private HyperwalletErrorList hyperwalletErrorList;

    public HyperwalletException(final Exception e) {
        super(e);
    }

    public HyperwalletException(final Response response, final int code, final String message) {
        super(message);

        this.response = response;
        errorCode = Integer.toString(code);
        errorMessage = message;
    }

    public HyperwalletException(final Response response, final int code, final String message, final Exception e) {
        super(e);

        this.response = response;
        errorCode = Integer.toString(code);
        errorMessage = message;
    }

    public HyperwalletException(final Response response, final HyperwalletErrorList hyperwalletErrorList) {
        super(hyperwalletErrorList.getErrors().get(0).getMessage());

        this.response = response;
        this.hyperwalletErrorList = hyperwalletErrorList;
        HyperwalletError error = this.hyperwalletErrorList.getErrors().get(0);