|
@@ -2,7 +2,6 @@ package com.wechi.adweb.bridge.exception;
|
|
|
|
|
|
import com.wechi.adweb.bridge.common.APIStatus;
|
|
|
import com.wechi.adweb.bridge.common.OpenAPIResponse;
|
|
|
-import com.wechi.adweb.bridge.google.analytics.dto.report.data.GAReportDataDTO;
|
|
|
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
|
|
@@ -12,7 +11,6 @@ import org.springframework.web.bind.annotation.ExceptionHandler;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
|
|
|
|
-import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
|
|
|
|
|
@@ -27,10 +25,10 @@ public class ExceptionAdvice {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
|
|
- @ExceptionHandler({BadRequestException.class})
|
|
|
+ @ExceptionHandler(BadRequestException.class)
|
|
|
public OpenAPIResponse<?> handleBadRequestException(BadRequestException e) {
|
|
|
log.error(Objects.toString(e.getApiRequest()), e);
|
|
|
- return OpenAPIResponse.<List<? extends GAReportDataDTO>>builder()
|
|
|
+ return OpenAPIResponse.builder()
|
|
|
.status(APIStatus.BAD_REQUEST)
|
|
|
.message("Invalid request parameters")
|
|
|
.build();
|
|
@@ -41,7 +39,7 @@ public class ExceptionAdvice {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
|
|
- @ExceptionHandler({DataException.class})
|
|
|
+ @ExceptionHandler(DataException.class)
|
|
|
public OpenAPIResponse<?> handleDataException(DataException e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
return OpenAPIResponse.builder()
|
|
@@ -55,7 +53,7 @@ public class ExceptionAdvice {
|
|
|
*/
|
|
|
@ResponseBody
|
|
|
@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
|
|
|
- @ExceptionHandler({Exception.class, RuntimeException.class})
|
|
|
+ @ExceptionHandler(Exception.class)
|
|
|
public OpenAPIResponse<?> handleException(Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
return OpenAPIResponse.builder()
|