[*] 修复异常问题

This commit is contained in:
acgist
2024-09-04 13:56:31 +08:00
parent 936f68c714
commit d7ee0ee99b

View File

@@ -213,6 +213,9 @@ public final class ErrorUtils {
* @see DefaultHandlerExceptionResolver * @see DefaultHandlerExceptionResolver
*/ */
public static final MessageCode messageCode(int status, Throwable globalThrowable, Throwable rootThrowable) { public static final MessageCode messageCode(int status, Throwable globalThrowable, Throwable rootThrowable) {
if(rootThrowable == null || globalThrowable == null) {
return MessageCode.CODE_9999;
}
final Class<?> rootClazz = rootThrowable.getClass(); final Class<?> rootClazz = rootThrowable.getClass();
final Class<?> globalClazz = globalThrowable.getClass(); final Class<?> globalClazz = globalThrowable.getClass();
return CODE_MAPPING.entrySet().stream() return CODE_MAPPING.entrySet().stream()