fix:修改异常处理

This commit is contained in:
石崇礼 2025-01-15 17:34:43 +08:00
parent 7b0a2a98cd
commit 8fb13e026b
2 changed files with 4 additions and 6 deletions

View File

@ -97,9 +97,7 @@ public class ControllerAdvice {
*/ */
@ExceptionHandler(value = RuntimeException.class) @ExceptionHandler(value = RuntimeException.class)
public Result<String> runtimeException(RuntimeException e){ public Result<String> runtimeException(RuntimeException e){
if (!e.getMessage().isEmpty()){ log.error("运行时异常:{}", e.getMessage());
log.error("运行时异常 消息为: {}", e.getMessage());
}
if (e instanceof RRException){ if (e instanceof RRException){
RRException rrException = (RRException) e; RRException rrException = (RRException) e;
return Result.error(rrException.getCode(), rrException.getMsg()); return Result.error(rrException.getCode(), rrException.getMsg());

View File

@ -26,11 +26,11 @@ public enum ErrorEnum implements ErrorInterface{
FAIL(500, "系统异常"), FAIL(500, "系统异常"),
/** /**
* 所有的空指针异常 * 调用对象位空(null)
* @code 10002 * @code 10002
* @apiNote 填写信息为空 * @apiNote 调用对象位空(null)
*/ */
NULL_POINTER_EXCEPTION(501, "填写信息为空"), NULL_POINTER_EXCEPTION(501, "调用对象位空(null)"),
/** /**
* 运行时异常, * 运行时异常,