[ https://issues.apache.org/jira/browse/NIFI-7264?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17060909#comment-17060909 ]
Shawn Weeks commented on NIFI-7264: ----------------------------------- 8:17 the code just catches Exception Shawn Weeks 8:17 AM I can't actually make my expected use case fail in 12 snapsho 8:17 I wonder if something has changed recently ottO 8:18 AM if the type is specific enough, then maybe the handling could be better Chris S 8:21 AM com.jayway.jsonpath.PathNotFoundException: No results for path: ... Shawn Weeks 8:22 AM It only fails on nested paths for missing paths and no error is shown in the UI 8:22 So right now we are logging and not throwing ottO 8:22 AM Right, I found the code Chris S 8:22 AM March 17th 2020, 13:11:30 at org.apache.nifi.attribute.expression.language.evaluation.functions.JsonPathEvaluator.evaluate(JsonPathEvaluator.java:48)   March 17th 2020, 13:11:30 at org.apache.nifi.attribute.expression.language.evaluation.functions.IsEmptyEvaluator.evaluate(IsEmptyEvaluator.java:35)   March 17th 2020, 13:11:30 at org.apache.nifi.attribute.expression.language.evaluation.functions.AndEvaluator.evaluate(AndEvaluator.java:54)   March 17th 2020, 13:11:30 com.jayway.jsonpath.PathNotFoundException: No results for path: $['...']['...'] Shawn Weeks 8:22 AM So the end user has no visbility unless they check the log. Chris S 8:22 AM (stack trace components reversed as they're chipped to Elasticsearch) new messages ottO 8:23 AM What would you expect to happen with the api as it is? Not Log? Fail Hard? Shawn Weeks 8:24 AM I'd say if it's a normally expected scenario that we wouldn't log it and sparsely populate JSON is a normal scenario. Right now we're logging all errors from JsonPathEvaluator and not raising any of them lol ottO 8:24 AM log debug? Shawn Weeks 8:24 AM That would work Chris S 8:25 AM I'd struggle with failures unless there were a way to accept "path not found" - it's fine (in my use case) for the path to not be present Kart 8:25 AM Shall we start a thread if its fine. so all the communication will be under one thread. 4 replies Last reply today at 8:28 AMView thread ottO 8:25 AM I don’t know how that function is documented Shawn Weeks 8:26 AM @Kart I can't figure out how to start a thread ottO 8:27 AM how about @Shawn Weeks or @Chris S create a jira and post the number here, and we discuss there 8:28 i’m willing to do a pr if it turns out not to be crazy Shawn Weeks 8:28 AM @ottO I'll put a jira in now :+1: 1 > Make jsonPath Expression Logging More Reasonable > ------------------------------------------------ > > Key: NIFI-7264 > URL: https://issues.apache.org/jira/browse/NIFI-7264 > Project: Apache NiFi > Issue Type: Improvement > Reporter: Shawn Weeks > Priority: Trivial > > Currently JsonPathEvaluator logs on all errors despite some errors like the > PathNotFoundException that might only need to be logged at the debug level. > Since these kind of errors aren't returned to the UI we're just filling up > the logs. -- This message was sent by Atlassian Jira (v8.3.4#803005)