Commit bd9e9793 authored by 杨锐's avatar 杨锐

sentry测试,避免不必要的异常报警。

parent 8d609355
......@@ -22,7 +22,8 @@ public class CustomSentryExceptionResolver implements HandlerExceptionResolver,
HttpServletResponse response,
Object handler,
Exception ex) {
if (ex instanceof VerificationCodeErrorException || ex instanceof DataException) {
// TODO: 2020/2/4 临时测试,后期修改成通用。
if (ex instanceof VerificationCodeErrorException) {
return null;
}
Sentry.capture(ex);
......
package cn.quantgroup.xyqb.controller.phonenoidno;
import cn.quantgroup.xyqb.exception.DataException;
import cn.quantgroup.xyqb.exception.VerificationCodeErrorException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Slf4j
@RestController
@RequestMapping("/v1/dummy")
public class DummyController {
// TODO: 2020/2/4 测试
@GetMapping
public void dummy() {
log.info("dummy rui测试.");
throw new VerificationCodeErrorException("rui测试.");
}
@GetMapping("/1")
public void dummy1() {
log.info("dummy1 rui测试.");
throw new DataException("rui测试.");
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment