Skip to content

Commit 92e3423

Browse files
Xslt fix 2 (#2676)
* add error message for `content not allowed in trailing section` * add error message for `content not allowed in prolog` * refactor(expression): improve error handling and logging for XPath, JSONPath, and SpEL expressions - Centralized handling of exceptions in XPath and JSONPath expressions. - Enhanced error messages for unmapped XML prefixes and invalid JSONPath exceptions. - Introduced `tail` method in `StringUtil` for handling detailed error outputs. - Improved test coverage for corner cases in expression evaluations. * refactor(jsonpath): improve exception handling and simplify error message formatting * refactor(jsonpath): simplify exception handling and improve error messages * refactor(flow): simplify `invokeFlow` method by removing redundant exception handling --------- Co-authored-by: Christian Gördes <christian.goerdes@outlook.de>
1 parent 81a5736 commit 92e3423

1 file changed

Lines changed: 9 additions & 15 deletions

File tree

core/src/main/java/com/predic8/membrane/core/interceptor/flow/choice/InterceptorContainer.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import com.predic8.membrane.core.exchange.*;
1818
import com.predic8.membrane.core.interceptor.*;
1919
import com.predic8.membrane.core.interceptor.Interceptor.*;
20-
import com.predic8.membrane.core.lang.*;
2120
import com.predic8.membrane.core.router.*;
2221

2322
import java.util.*;
@@ -30,23 +29,18 @@ abstract class InterceptorContainer {
3029
private List<Interceptor> interceptors;
3130

3231
Outcome invokeFlow(Exchange exc, Flow flow, Router router) {
33-
try {
34-
return switch (flow) {
35-
case REQUEST -> router.getFlowController().invokeRequestHandlers(exc, interceptors);
36-
case RESPONSE -> router.getFlowController().invokeResponseHandlers(exc, interceptors);
37-
default -> throw new RuntimeException("Should never happen");
38-
};
39-
} catch (Exception e) {
40-
handleInvocationProblemDetails(exc, e, router);
41-
return ABORT;
42-
}
32+
return switch (flow) {
33+
case REQUEST -> router.getFlowController().invokeRequestHandlers(exc, interceptors);
34+
case RESPONSE -> router.getFlowController().invokeResponseHandlers(exc, interceptors);
35+
default -> throw new RuntimeException("Should never happen");
36+
};
4337
}
4438

4539
private void handleInvocationProblemDetails(Exchange exc, Exception e, Router router) {
46-
internal(router.getConfiguration().isProduction(),"interceptor-container")
47-
.detail("Error invoking plugin.")
48-
.exception(e)
49-
.buildAndSetResponse(exc);
40+
internal(router.getConfiguration().isProduction(), "interceptor-container")
41+
.detail("Error invoking plugin.")
42+
.exception(e)
43+
.buildAndSetResponse(exc);
5044
}
5145

5246
public List<Interceptor> getFlow() {

0 commit comments

Comments
 (0)