package com.bb.exception;

import com.bb.model.ApiResponse;

/**
 * @FileName : ApiException
 * @Project : skhappy
 * @Date : 2019. 04. 10.
 * @Author : pulip
 * @Description :
 */
public class ApiException extends Exception {
    protected ApiResponse apiResponse;

    public ApiException() {
        this("E001", "오류가 발생하였습니다.");
    }

    public ApiException(String message) {
        this("E001", message);
    }

    /*public ApiException(ApiResponse apiResponse) {
        this(apiResponse, "오류가 발생하였습니다.");
    }*/

    public ApiException(String resultCode, String message) {
        this.apiResponse = new ApiResponse();

        this.apiResponse.setResultCode(resultCode);
        this.apiResponse.setResultMessage(message);
    }

    public ApiResponse getApiResponse() {
        return this.apiResponse;
    }
}
