From 8f085d531cfdf8159346a493a17f727d0dafbc7f Mon Sep 17 00:00:00 2001 From: janithcmw Date: Tue, 8 Feb 2022 16:21:38 +0530 Subject: [PATCH] log data in json object conversion. --- .../json/function/ToJSONObjectFunctionExtension.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/component/src/main/java/io/siddhi/extension/execution/json/function/ToJSONObjectFunctionExtension.java b/component/src/main/java/io/siddhi/extension/execution/json/function/ToJSONObjectFunctionExtension.java index ebe69c3..5c7401a 100644 --- a/component/src/main/java/io/siddhi/extension/execution/json/function/ToJSONObjectFunctionExtension.java +++ b/component/src/main/java/io/siddhi/extension/execution/json/function/ToJSONObjectFunctionExtension.java @@ -125,7 +125,15 @@ protected Object execute(Object data, State state) { returnValue = jsonParser.parse(data.toString()); } catch (ParseException e) { log.error(siddhiQueryContext.getSiddhiAppContext().getName() + ":" + siddhiQueryContext.getName() + - ": Cannot parse the given string into JSON. Hence returning null"); + ": Cannot parse the given string, '" + data.toString() + "', into JSON. Hence returning null"); + log.error("The error stack trace for the catch of 'ParseException' in " + + "'ToJSONObjectFunctionExtension' is : ", e); + } catch (Exception e) { + log.error("An error occurred when parsing to the json object. The data which " + + "was trying to convert is : '" + data.toString() + "."); + log.error("The error stack trace for the catch of 'Exception' in 'ToJSONObjectFunctionExtension' " + + "is : ", e); + throw e; } return returnValue; }