Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Core » ParseJSON now throws exception
ParseJSON now throws exception [message #49135] Sun, 24 December 2017 21:48 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

If non-json data is met, old version of ParseJSON just returned error Value. The current version of ParseJSON looks like thrown an exception. This is not very good because it is different behavior which conflicts with old codebase. So I propose considering it a bug.
Re: ParseJSON now throws exception [message #49136 is a reply to message #49135] Mon, 25 December 2017 07:16 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Mindtraveller wrote on Sun, 24 December 2017 21:48
If non-json data is met, old version of ParseJSON just returned error Value. The current version of ParseJSON looks like thrown an exception. This is not very good because it is different behavior which conflicts with old codebase. So I propose considering it a bug.


There was no change.

However, there were always two overloads:

Value ParseJSON(CParser& p);
Value ParseJSON(const char *s);

First one throws, second one returns Void.
Re: ParseJSON now throws exception [message #49139 is a reply to message #49136] Mon, 25 December 2017 23:33 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
In any way it would be great to have the line were the error appears.

Best regards
IƱaki
Re: ParseJSON now throws exception [message #49140 is a reply to message #49139] Mon, 25 December 2017 23:45 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
koldo wrote on Mon, 25 December 2017 23:33
In any way it would be great to have the line were the error appears.


If you need the line, you CParser version and catch the exception....
Previous Topic: how to use xmlparser to parse this document?
Next Topic: CreateSymbolicLink doesn't compile using MinGW
Goto Forum:
  


Current Time: Fri Apr 19 20:37:10 CEST 2024

Total time taken to generate the page: 0.05063 seconds