|
|
@ -1,6 +1,5 @@ |
|
|
|
package com.logpm.report.config; |
|
|
|
package com.logpm.report.config; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springblade.core.tenant.exception.TenantDataSourceException; |
|
|
|
import org.springblade.core.tenant.exception.TenantDataSourceException; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
import org.springblade.core.tool.api.R; |
|
|
@ -23,9 +22,7 @@ public class ReportExceptionHandler { |
|
|
|
@ResponseStatus(HttpStatus.BAD_REQUEST) |
|
|
|
@ResponseStatus(HttpStatus.BAD_REQUEST) |
|
|
|
public ResponseEntity<Object> handleCustomException(TenantDataSourceException e) { |
|
|
|
public ResponseEntity<Object> handleCustomException(TenantDataSourceException e) { |
|
|
|
String errorMessage = e.getMessage(); |
|
|
|
String errorMessage = e.getMessage(); |
|
|
|
JSONObject js = new JSONObject(); |
|
|
|
return new ResponseEntity<>(R.fail(ResultCode.FAILURE.getCode(),errorMessage), HttpStatus.BAD_REQUEST); |
|
|
|
js.put("msg",errorMessage); |
|
|
|
|
|
|
|
return new ResponseEntity<>(R.data(ResultCode.FAILURE.getCode(),js,errorMessage), HttpStatus.BAD_REQUEST); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|