package com.oqpo.api.exception;

import com.oqpo.api.enums.SystemMessageCode;
import lombok.Getter;

@Getter
public class GlobalException extends RuntimeException {
	private static final long serialVersionUID = 1L;

	private SystemMessageCode systemMessageCode;
	private String errorCode;
	private String message;
	private Throwable cause;

	public GlobalException(SystemMessageCode systemMessageCode) {
        super(String.valueOf(systemMessageCode.getId()));
        this.systemMessageCode = systemMessageCode;
    }

    public GlobalException(String errorCode) {
        super(errorCode);
    }

    public GlobalException(String errorCode, String message) {
        super(message);
        this.errorCode = errorCode;
        this.message = message;
    }

    public GlobalException(String errorCode, String message, Throwable cause) {
        super(message, cause);
        this.errorCode = errorCode;
        this.message = message;
        this.cause = cause;
    }

    public GlobalException(Throwable cause) {
        super(cause);
    }
}
