Commit f847f28e by guominglei

Merge remote-tracking branch 'origin/developer' into developer

parents b0d45cea 29ddf50f
...@@ -5,6 +5,7 @@ import com.byit.enums.TransferResultEnum; ...@@ -5,6 +5,7 @@ import com.byit.enums.TransferResultEnum;
import com.byit.gateway.utils.GatewayLogUtil; import com.byit.gateway.utils.GatewayLogUtil;
import com.netflix.zuul.context.RequestContext; import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException; import com.netflix.zuul.exception.ZuulException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.web.ErrorController; import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
...@@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletResponse; ...@@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
* @author huangfu * @author huangfu
*/ */
@RestController @RestController
@Slf4j
public class ErrorHandlerController implements ErrorController { public class ErrorHandlerController implements ErrorController {
@Override @Override
public String getErrorPath() { public String getErrorPath() {
...@@ -30,8 +32,10 @@ public class ErrorHandlerController implements ErrorController { ...@@ -30,8 +32,10 @@ public class ErrorHandlerController implements ErrorController {
if (exception == null) { if (exception == null) {
code = TransferResultEnum.ERROR.getCode(); code = TransferResultEnum.ERROR.getCode();
msg = "网关异常:"+TransferResultEnum.ERROR.getMsg(); msg = "网关异常:"+TransferResultEnum.ERROR.getMsg();
log.error("网关异常:{}",TransferResultEnum.ERROR.getMsg());
}else { }else {
msg ="网关异常:" + GatewayLogUtil.getMessage(exception); msg ="网关异常:请检查调度服务是否成功启动!";
log.error("网关异常:{}",GatewayLogUtil.getMessage(exception));
code = exception.nStatusCode+""; code = exception.nStatusCode+"";
} }
ResponseResult responseResult = new ResponseResult(); ResponseResult responseResult = new ResponseResult();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment