You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/12/09 19:42:00 UTC
[jira] [Commented] (CAMEL-17307) Possibility to define the exception thrown when predicate is used in validate camel dsl node
[ https://issues.apache.org/jira/browse/CAMEL-17307?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17456696#comment-17456696 ]
Claus Ibsen commented on CAMEL-17307:
-------------------------------------
I dont like changing the predicate api, but instead there could maybe be a ThrowingPredicate interface that the validator can check and use to throw this exception instead of its own
> Possibility to define the exception thrown when predicate is used in validate camel dsl node
> --------------------------------------------------------------------------------------------
>
> Key: CAMEL-17307
> URL: https://issues.apache.org/jira/browse/CAMEL-17307
> Project: Camel
> Issue Type: Improvement
> Components: came-core
> Reporter: Tom Cassimon
> Priority: Major
>
> It would be nice to allow the PredicateValidatingProcessor to throw a custom predefined exeption (defined in the Predicate maybe) and check if the Predicate has the custom exception and then throw that exception instead of a generic PredicateValidationException, to allow custom behaviour higher up in the stack depending on which validation has gone wrong.
>
> Maybe add a default method to the Predicate interface to get the configured exception that defaults to the current exception. I can make a pull request if you like.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)