Commit 6ed3903c by guojuxing

错误吗调整

parent 45d86452
......@@ -23,7 +23,7 @@
<gic-store-api>4.0-SNAPSHOT</gic-store-api>
<gic-redis-data>4.0-SNAPSHOT</gic-redis-data>
<gic-bizdict-api>4.0.0-SNAPSHOT</gic-bizdict-api>
<gic-platform-enterprise-api>4.0.0-SNAPSHOT</gic-platform-enterprise-api>
<gic-platform-enterprise-api>4.0-SNAPSHOT</gic-platform-enterprise-api>
</properties>
<dependencies>
......
package com.gic.enterprise.web.exception;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.store.constant.StoreGroupErrorEnum;
import com.gic.store.exception.StoreException;
import com.gic.store.exception.StoreGroupException;
import com.gic.store.utils.ErrorCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException;
......@@ -34,7 +34,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class)
public RestResponse controllerException(HttpServletResponse response, Exception ex) {
logger.error("err", ex);
RestResponse failureResponse = getRestResponse(ErrorCode.ERR_3.getCode(), ErrorCode.ERR_3.getMsg());
RestResponse failureResponse = getRestResponse(ErrorCode.SYSTEM_ERROR.getCode(), ErrorCode.SYSTEM_ERROR.getMsg());
StringBuilder sb = new StringBuilder();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (PrintWriter printWriter = new PrintWriter(baos)) {
......@@ -76,7 +76,7 @@ public class GlobalExceptionHandler {
Set<ConstraintViolation<?>> constraintViolations = e.getConstraintViolations();
String paramName = constraintViolations.iterator().next().getPropertyPath().toString();
String paramError = constraintViolations.iterator().next().getMessage();
return getRestResponse(com.gic.enterprise.error.ErrorCode.ERR_5.getCode(), getFailFastMsg(paramName, paramError));
return getRestResponse(ErrorCode.PARAMETER_ERROR.getCode(), getFailFastMsg(paramName, paramError));
}
/**
......
package com.gic.operation.web.exception;
import com.gic.commons.webapi.reponse.RestResponse;
import com.gic.enterprise.error.ErrorCode;
import com.gic.store.constant.StoreGroupErrorEnum;
import com.gic.store.exception.StoreException;
import com.gic.store.exception.StoreGroupException;
import com.gic.store.utils.ErrorCode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.validation.BindException;
......@@ -34,7 +34,7 @@ public class GlobalExceptionHandler {
@ExceptionHandler(Exception.class)
public RestResponse controllerException(HttpServletResponse response, Exception ex) {
logger.error("err", ex);
RestResponse failureResponse = getRestResponse(ErrorCode.ERR_3.getCode(), ErrorCode.ERR_3.getMsg());
RestResponse failureResponse = getRestResponse(ErrorCode.SYSTEM_ERROR.getCode(), ErrorCode.SYSTEM_ERROR.getMsg());
StringBuilder sb = new StringBuilder();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try (PrintWriter printWriter = new PrintWriter(baos)) {
......@@ -76,7 +76,7 @@ public class GlobalExceptionHandler {
Set<ConstraintViolation<?>> constraintViolations = e.getConstraintViolations();
String paramName = constraintViolations.iterator().next().getPropertyPath().toString();
String paramError = constraintViolations.iterator().next().getMessage();
return getRestResponse(com.gic.enterprise.error.ErrorCode.ERR_5.getCode(), getFailFastMsg(paramName, paramError));
return getRestResponse(ErrorCode.PARAMETER_ERROR.getCode(), getFailFastMsg(paramName, paramError));
}
/**
......
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