Skip to content
Discussion options

You must be logged in to vote

custom_error_message is typically empty, unless you implement some special custom error handling. Instead, you should have an else on your if (!foo) check and use glz::format_error to nicely format the error:

std::cout<< glz::format_error(foo, json) << std::endl;

You can also use glz::ex::read_json if you would prefer exceptions to be thrown on errors.

If you use either of those approaches you'll get an error back.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@stephenberry
Comment options

Answer selected by Curculigo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants