mirror of
https://github.com/hs-web/hsweb-framework.git
synced 2026-09-03 06:35:25 +08:00
refactor: 优化异常匹配逻辑
This commit is contained in:
@@ -47,7 +47,12 @@ public class ExceptionAnalyzerReporter implements ExceptionAnalyzer {
|
||||
|
||||
protected void addSimpleReporter(Pattern pattern, Consumer<Throwable> reporter) {
|
||||
|
||||
addReporter((error) -> pattern.matcher(error.toString()).matches(), reporter);
|
||||
addReporter((error) -> {
|
||||
if (error.getMessage() == null) {
|
||||
return pattern.matcher(error.toString()).matches();
|
||||
}
|
||||
return pattern.matcher(error.getMessage()).matches() || pattern.matcher(error.toString()).matches();
|
||||
}, reporter);
|
||||
}
|
||||
|
||||
public boolean doReportException(Throwable failure) {
|
||||
|
||||
Reference in New Issue
Block a user