mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix JSONException
This commit is contained in:
parent
b4ce196a7c
commit
1062caceea
@ -12,8 +12,7 @@
|
|||||||
|
|
||||||
package org.dromara.hutool.json;
|
package org.dromara.hutool.json;
|
||||||
|
|
||||||
import org.dromara.hutool.core.exception.ExceptionUtil;
|
import org.dromara.hutool.core.exception.HutoolException;
|
||||||
import org.dromara.hutool.core.text.StrUtil;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JSON异常
|
* JSON异常
|
||||||
@ -21,30 +20,67 @@ import org.dromara.hutool.core.text.StrUtil;
|
|||||||
* @author looly
|
* @author looly
|
||||||
* @since 3.0.2
|
* @since 3.0.2
|
||||||
*/
|
*/
|
||||||
public class JSONException extends RuntimeException {
|
public class JSONException extends HutoolException {
|
||||||
private static final long serialVersionUID = 0;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造
|
||||||
|
*
|
||||||
|
* @param e 异常
|
||||||
|
*/
|
||||||
public JSONException(final Throwable e) {
|
public JSONException(final Throwable e) {
|
||||||
super(ExceptionUtil.getMessage(e), e);
|
super(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造
|
||||||
|
*
|
||||||
|
* @param message 消息
|
||||||
|
*/
|
||||||
public JSONException(final String message) {
|
public JSONException(final String message) {
|
||||||
super(message);
|
super(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造
|
||||||
|
*
|
||||||
|
* @param messageTemplate 消息模板
|
||||||
|
* @param params 参数
|
||||||
|
*/
|
||||||
public JSONException(final String messageTemplate, final Object... params) {
|
public JSONException(final String messageTemplate, final Object... params) {
|
||||||
super(StrUtil.format(messageTemplate, params));
|
super(messageTemplate, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造
|
||||||
|
*
|
||||||
|
* @param message 消息
|
||||||
|
* @param cause 被包装的子异常
|
||||||
|
*/
|
||||||
public JSONException(final String message, final Throwable cause) {
|
public JSONException(final String message, final Throwable cause) {
|
||||||
super(message, cause);
|
super(message, cause);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONException(final String message, final Throwable throwable, final boolean enableSuppression, final boolean writableStackTrace) {
|
/**
|
||||||
super(message, throwable, enableSuppression, writableStackTrace);
|
* 构造
|
||||||
|
*
|
||||||
|
* @param message 消息
|
||||||
|
* @param cause 被包装的子异常
|
||||||
|
* @param enableSuppression 是否启用抑制
|
||||||
|
* @param writableStackTrace 堆栈跟踪是否应该是可写的
|
||||||
|
*/
|
||||||
|
public JSONException(final String message, final Throwable cause, final boolean enableSuppression, final boolean writableStackTrace) {
|
||||||
|
super(message, cause, enableSuppression, writableStackTrace);
|
||||||
}
|
}
|
||||||
|
|
||||||
public JSONException(final Throwable throwable, final String messageTemplate, final Object... params) {
|
/**
|
||||||
super(StrUtil.format(messageTemplate, params), throwable);
|
* 构造
|
||||||
|
*
|
||||||
|
* @param cause 被包装的子异常
|
||||||
|
* @param messageTemplate 消息模板
|
||||||
|
* @param params 参数
|
||||||
|
*/
|
||||||
|
public JSONException(final Throwable cause, final String messageTemplate, final Object... params) {
|
||||||
|
super(cause, messageTemplate, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user