package com.banesco.commons.exceptions;


import com.banesco.commons.config.StatusCodes;
import lombok.Getter;

@Getter
public class BanRuntimeException extends RuntimeException {

    protected String backCode;
    protected String backDesc;

    public BanRuntimeException(String backCode, String backDesc) {
        super(backDesc);
        this.backCode = backCode;
        this.backDesc = backDesc;
    }

    public BanRuntimeException(StatusCodes statusCodes, String target) {
        super(statusCodes.getStatusDesc().formatted(target));
        this.backCode = statusCodes.getStatusCode();
        this.backDesc = statusCodes.getStatusDesc().formatted(target);
    }
}
