package com.gree.mall.miniapp.exception;


import com.gree.mall.miniapp.helper.ResponseHelper;
import com.gree.mall.miniapp.helper.ResponseHelper;
import org.springframework.http.ResponseEntity;

public class RemoteServiceException extends RuntimeException {
    private int status;
    private String message;



    public RemoteServiceException(String message){
        this.status = ResponseHelper.ResponseCode_COMMON;
        this.message = message;
    }

    public RemoteServiceException(int status, String message) {

        this.status = status;
        this.message = message;

    }

    @Override
    public String getMessage() {
        return this.message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public int getCode() {
        return this.status;
    }

    public ResponseHelper toResponse(){
        return ResponseHelper.error(this.status,this.message);
    }
}
