All Downloads are FREE. Search and download functionalities are using the official Maven repository.

cn.gomro.commons.restful.api.response.error.BaseException Maven / Gradle / Ivy

There is a newer version: 0.0.15
Show newest version
package cn.gomro.commons.restful.api.response.error;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;

@Data
@EqualsAndHashCode(callSuper = true)
public class BaseException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = -6875838312173763613L;

    // 202 是http状态码 服务器已接受请求,但尚未处理。
    private long httpCode = 202;
    private ErrorData errorData;

    public BaseException(String message) {
        super(message);
    }

    public  BaseException(long code, String message, T data) {
        super(message);
        this.httpCode = code;
        if (data instanceof ErrorData) {
            this.errorData = (ErrorData) data;
        }
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy