public class BizException extends RuntimeException
业务异常
NOTE: 通常表示业务中的意外情况。如:用户错误输入、缺失必填字段、用户余额不足等。
| Modifier | Constructor and Description |
|---|---|
protected |
BizException(String message)
使用指定的
message 构造新的业务异常。 |
protected |
BizException(String message,
Throwable cause)
使用指定的
message 和 cause 构造新的业务异常。 |
protected |
BizException(Throwable cause)
使用指定的
cause 构造新的业务异常。 |
| Modifier and Type | Method and Description |
|---|---|
static BizException |
of() |
static BizException |
of(String message) |
static BizException |
of(String errorMessageFormat,
Object... errorMessageArgs) |
static BizException |
of(String message,
Throwable cause) |
static BizException |
of(Throwable cause) |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringprotected BizException(String message)
message - 异常信息protected BizException(Throwable cause)
cause 构造新的业务异常。
message 为 (cause==null ? null : cause.toString())。cause - 包装的异常public static BizException of()
public static BizException of(String message)
public static BizException of(String errorMessageFormat, Object... errorMessageArgs)
public static BizException of(Throwable cause)
public static BizException of(String message, Throwable cause)
Copyright © 2026. All rights reserved.