public class ErrorUtil extends Object
| 构造器和说明 |
|---|
ErrorUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
badRequest()
请求错误
|
static void |
badRequest(String message)
请求错误
|
static void |
error(String message)
业务错误
|
static void |
error(String i18n,
String defaultMessage)
业务错误
|
static void |
error(String i18n,
String defaultMessage,
Object... args)
业务错误
|
static void |
forbidden()
禁止访问
|
static void |
forbidden(String message)
禁止访问
|
static Throwable |
getCause(Throwable e)
获取最顶部异常
|
static String |
getNullTrace(NullPointerException e)
获取空引用顶部追踪
|
static String |
getNullTrace(NullPointerException e,
int level)
获取空引用顶部追踪
|
static void |
noAccess()
无权限
|
static void |
noAccess(String message)
无权限
|
static void |
noAuthorization()
未授权
|
static void |
noAuthorization(String message)
未授权
|
static void |
notFound()
未找到操作主体
|
static void |
notFound(String message)
未找到操作主体
|
static void |
serverError()
服务器错误
|
static void |
serverError(String message)
服务器错误
|
public static String getNullTrace(NullPointerException e)
e - public static String getNullTrace(NullPointerException e, int level)
e - level - public static void badRequest()
throws Error400Exception
public static void badRequest(String message) throws Error400Exception
message - Error400Exceptionpublic static void noAuthorization()
throws Error401Exception
public static void noAuthorization(String message) throws Error401Exception
message - Error401Exceptionpublic static void forbidden()
throws Error403Exception
public static void forbidden(String message) throws Error403Exception
message - Error403Exceptionpublic static void notFound()
throws Error404Exception
public static void notFound(String message) throws Error404Exception
public static void noAccess()
throws Error405Exception
public static void noAccess(String message) throws Error405Exception
message - Error405Exceptionpublic static void serverError()
throws WebException
WebExceptionpublic static void serverError(String message) throws WebException
message - WebExceptionpublic static void error(String message) throws BusinessException
message - BusinessExceptionpublic static void error(String i18n, String defaultMessage) throws BusinessException
i18n - defaultMessage - BusinessExceptionpublic static void error(String i18n, String defaultMessage, Object... args) throws BusinessException
i18n - defaultMessage - allow nullargs - BusinessExceptionCopyright © 2025. All rights reserved.