You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/12/13 08:18:26 UTC

[GitHub] [camel] TCke83 opened a new pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

TCke83 opened a new pull request #6531:
URL: https://github.com/apache/camel/pull/6531


   …ate the possibility to throw a custom exception when validation fails
   
   This would allow for defining a custom exception when a certain predicate in the validate camel DSL doesn't match the expectations defined in the predicate.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1019456845


   Take a look at
   https://github.com/apache/camel/commit/ed4d79bef73fdb650d8c4b8531f3441b7224f620
   
   The unit tests show what you can do. If you have feedback, suggestions then you are welcome to post them, or send a PR from the main branch.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-993366534


   I think a factory is a good idea, but then you can implement a custom factory where you can build your custom exceptions based on the predicate. I do not think we should/need to add some `HasCustomException` interface but just rely on the predicate instance where you can check yourself what you want to do, in your custom factory.
   
   Then this is non invasive on the camel-core.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] TCke83 edited a comment on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
TCke83 edited a comment on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1023538341


   Code change looks good, nice to be able to set it globally (using the
   registry) and locally in the route.
   
   Going to try it out but it seems a fit for the use case i need it for.
   
   Thanks a lot!
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus closed pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
davsclaus closed pull request #6531:
URL: https://github.com/apache/camel/pull/6531


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] TCke83 commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
TCke83 commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1023538341


   Code change looks good, nice to be able to set it globally (using the
   registry) and locally in the route.
   
   Going to try it out but it seems a fit for the use case i need it for.
   
   Thanks a lot!
   
   Op zo 23 jan. 2022 om 11:39 schreef Claus Ibsen ***@***.***>:
   
   > Take a look at
   > ed4d79b
   > <https://github.com/apache/camel/commit/ed4d79bef73fdb650d8c4b8531f3441b7224f620>
   >
   > The unit tests show what you can do. If you have feedback, suggestions
   > then you are welcome to post them, or send a PR from the main branch.
   >
   > —
   > Reply to this email directly, view it on GitHub
   > <https://github.com/apache/camel/pull/6531#issuecomment-1019456845>, or
   > unsubscribe
   > <https://github.com/notifications/unsubscribe-auth/AA227UCUOESTSOYNATDNYLDUXPLEZANCNFSM5J5PPAZA>
   > .
   > Triage notifications on the go with GitHub Mobile for iOS
   > <https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
   > or Android
   > <https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
   >
   > You are receiving this because you were mentioned.Message ID:
   > ***@***.***>
   >
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] TCke83 commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
TCke83 commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1001587347


   @davsclaus what is the best way to implement the wiring of the factory in the camel codebase?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] TCke83 commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
TCke83 commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-993226910


   What also could be a possible approach is to refactor the PredicateValidationException into a factory, it gets the predicate as an argument. That factory checks on a seperate interface of the supplied predicate, not extending from Predicate, e.g. HasCustomException or something like that. And if it implements the interface throw that exception, otherwise throw the default PredicateValidationException


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1008629497


   @TCke83 I added a suggestion to this branch (one commit)
   https://github.com/apache/camel/tree/throw-predicate
   
   Then what is needed is to make it possible from camel-validator to setup a custom exception factory. And add docs to the component. And add an unit test as well.
   
   Would you be able to help with that?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] davsclaus commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1019455144


   Oh sorry in the mean time I have been working on this. Have the implemented ready, just doing a rebuild of code before merging.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] TCke83 commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
TCke83 commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1019455916


   @davsclaus okay thanks, looking forward to use it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel] TCke83 commented on pull request #6531: CAMEL-17307: camel-support - Added ThrowingPredicate interface to cre…

Posted by GitBox <gi...@apache.org>.
TCke83 commented on pull request #6531:
URL: https://github.com/apache/camel/pull/6531#issuecomment-1019446757


   @davsclaus i'm going to try to do this next week. I'll keep this pull request updated.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org