Skip to content

Allow overriding JSON_THROW to something else than abort() #938

Description

@kaidokert

Feature Request

  • Describe the feature in as much detail as possible.

On an embedded/rtos system, the stack is compiled without rtti/exceptions, and I'm running http workers in a separate thread. I can deal with failures by basically tearing the thread down and restarting it, however, i don't want to call abort() specifically and unconditionally. Also it's nice to still be able to obtain the error code from the exception

  • Include sample usage where appropriate.

passing a -DJSON_THROW=my_deal_with_json_error(x) at compile time would allow easy customization of how the error handling gets dealt with

The addition is as simple as

#if !defined(JSON_THROW)
#define JSON_THROW abort
#endif

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions