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

cn.hippo4j.common.web.exception.ServiceException Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
package cn.hippo4j.common.web.exception;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * Service exception.
 *
 * @author chen.ma
 * @date 2021/3/19 16:14
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ServiceException extends RuntimeException {

    private static final long serialVersionUID = -8667394300356618037L;

    private String detail;

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

    public ServiceException(String message, String detail) {
        super(message);
        this.detail = detail;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
        this.detail = cause.getMessage();
    }

    public ServiceException(String message, String detail, Throwable cause) {
        super(message, cause);
        this.detail = detail;
    }

    @Override
    public String toString() {
        return "ServiceException{" +
                "message='" + getMessage() + "'," +
                "detail='" + getDetail() + "'" +
                '}';
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy