Commit f847f28e by guominglei

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

parents b0d45cea 29ddf50f
......@@ -5,6 +5,7 @@ import com.byit.enums.TransferResultEnum;
import com.byit.gateway.utils.GatewayLogUtil;
import com.netflix.zuul.context.RequestContext;
import com.netflix.zuul.exception.ZuulException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.autoconfigure.web.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
......@@ -15,6 +16,7 @@ import javax.servlet.http.HttpServletResponse;
* @author huangfu
*/
@RestController
@Slf4j
public class ErrorHandlerController implements ErrorController {
@Override
public String getErrorPath() {
......@@ -30,8 +32,10 @@ public class ErrorHandlerController implements ErrorController {
if (exception == null) {
code = TransferResultEnum.ERROR.getCode();
msg = "网关异常:"+TransferResultEnum.ERROR.getMsg();
log.error("网关异常:{}",TransferResultEnum.ERROR.getMsg());
}else {
msg ="网关异常:" + GatewayLogUtil.getMessage(exception);
msg ="网关异常:请检查调度服务是否成功启动!";
log.error("网关异常:{}",GatewayLogUtil.getMessage(exception));
code = exception.nStatusCode+"";
}
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