From: Baptiste L. <bap...@gm...> - 2011-05-24 15:44:00
|
2011/5/24 Aaron Jacobs <ja...@go...> > On Tue, May 24, 2011 at 3:06 AM, Baptiste Lepilleur > <bap...@gm...> wrote: > [...] > > - JSON_FAIL_MESSAGE is bugged if there is no exception (e.g. > > multi-statements). IMHO it should just call a function that dump message > and > > then call abort(). > > Sorry, I'm not sure I understand the first sentence here. Could you > clarify? > Sorry, I should have made this clearer: #define JSON_FAIL_MESSAGE( message ) std::cerr << message; exit(123); with: if (!ok) JSON_FAIL_MESSAGE(reader.getFormattedErrorMessages()); will becomes: if (!ok) std::cerr << message; exit(123); A simple way to avoid this is: #define JSON_FAIL_MESSAGE( message ) onJsonFailure( message ); Baptiste. |