Files
wxSend/src/main/java/cn/van333/wxsend/exception/RateLimitExceptionHandler.java
2023-10-17 14:32:24 +08:00

26 lines
739 B
Java
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package cn.van333.wxsend.exception;
import cn.van333.wxsend.business.model.R;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
* @author Leo
* @version 1.0
* @create 2023/10/10 0010 下午 05:28
* @description
*/
@ControllerAdvice
public class RateLimitExceptionHandler {
@ExceptionHandler(ServiceException.class)
@ResponseBody
public R handleRateLimitException(ServiceException ex) {
String errorMessage = ex.getMessage();
return R.error(errorMessage);
}
}