diff --git a/blade-service/logpm-report/src/main/java/com/logpm/report/config/ReportExceptionHandler.java b/blade-service/logpm-report/src/main/java/com/logpm/report/config/ReportExceptionHandler.java index 68cc90e57..e5fb61e08 100644 --- a/blade-service/logpm-report/src/main/java/com/logpm/report/config/ReportExceptionHandler.java +++ b/blade-service/logpm-report/src/main/java/com/logpm/report/config/ReportExceptionHandler.java @@ -1,6 +1,5 @@ package com.logpm.report.config; -import com.alibaba.fastjson.JSONObject; import lombok.extern.slf4j.Slf4j; import org.springblade.core.tenant.exception.TenantDataSourceException; import org.springblade.core.tool.api.R; @@ -23,9 +22,7 @@ public class ReportExceptionHandler { @ResponseStatus(HttpStatus.BAD_REQUEST) public ResponseEntity handleCustomException(TenantDataSourceException e) { String errorMessage = e.getMessage(); - JSONObject js = new JSONObject(); - js.put("msg",errorMessage); - return new ResponseEntity<>(R.data(ResultCode.FAILURE.getCode(),js,errorMessage), HttpStatus.BAD_REQUEST); + return new ResponseEntity<>(R.fail(ResultCode.FAILURE.getCode(),errorMessage), HttpStatus.BAD_REQUEST); } }