package vc.thinker.exception;

import cn.hutool.core.util.StrUtil;
import lombok.Getter;

/**
 * 异常信息
 *
 * @author xfy
 * @since 2022/1/18 9:56
 **/
public class CurrentLimitException extends RuntimeException {

    private static final long serialVersionUID = -6154899990522310326L;

    @Getter
    private final String code;

    public CurrentLimitException(String message) {
        super(message);
        this.code = "429";
    }

    public CurrentLimitException(String message, String code) {
        super(message);
        this.code = code;
    }

    public static CurrentLimitException of(String message) {
        return new CurrentLimitException(message);
    }

    public static CurrentLimitException of(String message, Object... argArray) {
        return of(StrUtil.format(message, argArray));
    }
}