2021-08-16 08:25:25 +00:00
|
|
|
|
package com.ruoyi.common.exception;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 全局异常
|
|
|
|
|
*
|
|
|
|
|
* @author ruoyi
|
|
|
|
|
*/
|
|
|
|
|
public class GlobalException extends RuntimeException
|
|
|
|
|
{
|
|
|
|
|
private static final long serialVersionUID = 1L;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 错误提示
|
|
|
|
|
*/
|
|
|
|
|
private String message;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 错误明细,内部调试错误
|
|
|
|
|
*
|
|
|
|
|
* 和 {@link CommonResult#getDetailMessage()} 一致的设计
|
|
|
|
|
*/
|
|
|
|
|
private String detailMessage;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 空构造方法,避免反序列化问题
|
|
|
|
|
*/
|
|
|
|
|
public GlobalException()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GlobalException(String message)
|
|
|
|
|
{
|
|
|
|
|
this.message = message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getDetailMessage()
|
|
|
|
|
{
|
|
|
|
|
return detailMessage;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GlobalException setDetailMessage(String detailMessage)
|
|
|
|
|
{
|
|
|
|
|
this.detailMessage = detailMessage;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 02:35:31 +00:00
|
|
|
|
@Override
|
2021-08-16 08:25:25 +00:00
|
|
|
|
public String getMessage()
|
|
|
|
|
{
|
|
|
|
|
return message;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public GlobalException setMessage(String message)
|
|
|
|
|
{
|
|
|
|
|
this.message = message;
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
}
|