Hairy Pixels via fpc-pascal <fpc-pascal@lists.freepascal.org> schrieb am Mi., 28. Sep. 2022, 16:17:
> Ok I narrowed down this bug I get with 3.2.2 to TJSONParser. > > I’m so confused as to what changed. FormatJSON prints the JSON as > expected but AsString crashes and gives the error I was seeing from the RPC > which it trapped as an exception. When it’s send across the RPC layer it > must call AsString and then blow up thus giving me this error. > > The JSON in question printed from FormatJSON is valid and can be opened in > a JSON editor even so I know it’s ok. > > =========================== > > Request := TJSONParser.Create(Content, DefaultOptions).Parse; > > writeln(Request.FormatJSON); // this prints the JSON correctly (Request > ClassName is TJSONObject) > > writeln(Request.AsString); > > gives this error: > > An unhandled exception occurred at $00000001050261A7: > EJSON: Cannot convert data from object value > $00000001050261A7 > How about you provide a more complete example instead of making us guess so that we can reproduce it? Regards, Sven >
_______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal