|
@@ -101,7 +101,8 @@ public class CustomExceptionHandler {
|
|
body = new StatusResponse(AppSelfHolder.get().getAppCode() + "-500",
|
|
body = new StatusResponse(AppSelfHolder.get().getAppCode() + "-500",
|
|
cause.getMessage());
|
|
cause.getMessage());
|
|
} else if (cause instanceof org.springframework.jdbc.CannotGetJdbcConnectionException
|
|
} else if (cause instanceof org.springframework.jdbc.CannotGetJdbcConnectionException
|
|
- || cause instanceof org.springframework.orm.jpa.JpaSystemException) {
|
|
|
|
|
|
+ || cause instanceof org.springframework.orm.jpa.JpaSystemException
|
|
|
|
+ || cause instanceof org.springframework.transaction.CannotCreateTransactionException) {
|
|
body = new StatusResponse("503", "limited");
|
|
body = new StatusResponse("503", "limited");
|
|
} else {
|
|
} else {
|
|
body = new StatusResponse(AppSelfHolder.get().getAppCode() + "-500", "系统异常");
|
|
body = new StatusResponse(AppSelfHolder.get().getAppCode() + "-500", "系统异常");
|
|
@@ -220,7 +221,8 @@ public class CustomExceptionHandler {
|
|
if (alwaysOK) {
|
|
if (alwaysOK) {
|
|
if (t instanceof ApiFlowLimitedException
|
|
if (t instanceof ApiFlowLimitedException
|
|
|| t instanceof org.springframework.jdbc.CannotGetJdbcConnectionException
|
|
|| t instanceof org.springframework.jdbc.CannotGetJdbcConnectionException
|
|
- || t instanceof org.springframework.orm.jpa.JpaSystemException) {
|
|
|
|
|
|
+ || t instanceof org.springframework.orm.jpa.JpaSystemException
|
|
|
|
+ || t instanceof org.springframework.transaction.CannotCreateTransactionException) {
|
|
httpStatus = HttpStatus.SERVICE_UNAVAILABLE;
|
|
httpStatus = HttpStatus.SERVICE_UNAVAILABLE;
|
|
printStackTrace = false;
|
|
printStackTrace = false;
|
|
} else {
|
|
} else {
|
|
@@ -229,7 +231,8 @@ public class CustomExceptionHandler {
|
|
} else {
|
|
} else {
|
|
if (t instanceof ApiFlowLimitedException
|
|
if (t instanceof ApiFlowLimitedException
|
|
|| t instanceof org.springframework.jdbc.CannotGetJdbcConnectionException
|
|
|| t instanceof org.springframework.jdbc.CannotGetJdbcConnectionException
|
|
- || t instanceof org.springframework.orm.jpa.JpaSystemException) {
|
|
|
|
|
|
+ || t instanceof org.springframework.orm.jpa.JpaSystemException
|
|
|
|
+ || t instanceof org.springframework.transaction.CannotCreateTransactionException) {
|
|
httpStatus = HttpStatus.SERVICE_UNAVAILABLE;
|
|
httpStatus = HttpStatus.SERVICE_UNAVAILABLE;
|
|
printStackTrace = false;
|
|
printStackTrace = false;
|
|
} else {
|
|
} else {
|