You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Preben.Asmussen" <pr...@dr.dk> on 2015/05/25 12:41:05 UTC

Re: How to suppress exceptions from @Jsonpath expressions?

Hi

Currently it's seems not possible to have optional jsonpath parameters on a
bean since the component will throw an PathNotFoundException on missing
path's.
I think jsonpath should return null on unknown path's instead of throwing
PathNotFoundException.
If i recall right thats also the behaviour of the XPath component.

It might be enough to just add the SUPRESS_EXCEPTIONS option to the jsonpath
configuration engine when it's constructed. 
I can provide a PR.

Any comments ?

Best,
Preben

 



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-suppress-exceptions-from-Jsonpath-expressions-tp5767384p5767442.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to suppress exceptions from @Jsonpath expressions?

Posted by "Preben.Asmussen" <pr...@dr.dk>.
Hi Claus

Created https://issues.apache.org/jira/browse/CAMEL-8799.

See comments 

Best,
Preben



--
View this message in context: http://camel.465427.n5.nabble.com/How-to-suppress-exceptions-from-Jsonpath-expressions-tp5767384p5767497.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: How to suppress exceptions from @Jsonpath expressions?

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Yeah we can add some option to turn this option on | off. Preben a
JIRA and PR is welcome.

On Mon, May 25, 2015 at 12:41 PM, Preben.Asmussen <pr...@dr.dk> wrote:
> Hi
>
> Currently it's seems not possible to have optional jsonpath parameters on a
> bean since the component will throw an PathNotFoundException on missing
> path's.
> I think jsonpath should return null on unknown path's instead of throwing
> PathNotFoundException.
> If i recall right thats also the behaviour of the XPath component.
>
> It might be enough to just add the SUPRESS_EXCEPTIONS option to the jsonpath
> configuration engine when it's constructed.
> I can provide a PR.
>
> Any comments ?
>
> Best,
> Preben
>
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-suppress-exceptions-from-Jsonpath-expressions-tp5767384p5767442.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
hawtio: http://hawt.io/
fabric8: http://fabric8.io/