From fcc27cb7ea1c0fba6e42b080d0d01f4f4db83596 Mon Sep 17 00:00:00 2001 From: linwl <304115325@qq.com> Date: Thu, 15 Apr 2021 16:25:06 +0800 Subject: [PATCH] =?UTF-8?q?IOT=E8=B0=83=E7=94=A8=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exception/GobalExceptionHandler.java | 30 ------------------- 1 file changed, 30 deletions(-) delete mode 100644 src/main/java/com/telpo/iotgateway/exception/GobalExceptionHandler.java diff --git a/src/main/java/com/telpo/iotgateway/exception/GobalExceptionHandler.java b/src/main/java/com/telpo/iotgateway/exception/GobalExceptionHandler.java deleted file mode 100644 index e5bf117..0000000 --- a/src/main/java/com/telpo/iotgateway/exception/GobalExceptionHandler.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.telpo.iotgateway.exception; - -import lombok.extern.slf4j.Slf4j; -import org.springframework.web.bind.annotation.ExceptionHandler; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.RestControllerAdvice; -import response.ERRORCODE; -import response.Result; - -import java.text.MessageFormat; - -/** - * @program: DataPushServer - * @description: 全局异常拦截 - * @author: linwl - * @create: 2020-07-11 10:29 - */ -@Slf4j -@RestControllerAdvice(basePackages = "com.telpo.datapushserver.controller") -public class GobalExceptionHandler { - @ExceptionHandler(value = Exception.class) - @ResponseBody - public Result exceptionErrorHandler(Exception e) throws Exception { - log.error(MessageFormat.format("推送服务发生异常:{0}!", e.getMessage()), e); - return new Result.Builder() - .setCode(ERRORCODE.SystemErr) - .setMessage(MessageFormat.format("系统发生异常:{0}!", e.getMessage())) - .build(); - } -}