Question on JSON handling
Posted: Sun Apr 30, 2023 1:41 am
Hi guys,
I'm trying to parse and get posted JSON values easily.
Here's an excerpt of what I'm doing
This fails when the Target is not a string and say it's an integer.
How do I catch this exception and handle it?
I'm trying to parse and get posted JSON values easily.
Here's an excerpt of what I'm doing
Code: Select all
JSON_ID = ParseJSON(#PB_Any, SomeStringReceived)
If JSON_ID
If GetJSONMember(JSONValue(JSON_ID), "Target")
Target.s = GetJSONString(GetJSONMember(JSONValue(JSON_ID), "TargetType"))
EndIf
EndIf
How do I catch this exception and handle it?