I don't think that actually proves that JSON Parse is throwing the runtime 
error.

rather than looking at the "line of code referenced in the error dialog"
perhaps you could activate debug log recording in verbose mode (2)
at the start of the offending method (and disable it a the end)

http://doc.4d.com/4Dv16R5/4D/16-R5/SET-DATABASE-PARAMETER.301-3481818.en.html

source code is stripped in a 4DC, so I wouldn't completely trust the line of 
code printing in the error dialog.

how do you looks at the string to see if it begins with "{" or "[" ?

you can't look at $json[[1]] because the string could be length 0 (instant 
runtime error).

besides, you shouldn't have to look at the string in the first place if you use 
JSON Parse with error handling.

2018/02/02 1:09、Kirk Brooks via 4D_Tech 
<4d_tech@lists.4d.com<mailto:4d_tech@lists.4d.com>> のメール:
​I got a runtime error on the server (v15.5) from a component. The source
of the error is probably attempting to call PARSE Json on a malformed
string (that's the line of code referenced in the error dialog). The method
looks at the string to see if it begins with "{" or "[" but that's all the
validating it does.



**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**********************************************************************

Reply via email to