Skip to content

Raise JSON::ParserError when Oj::ParseError would be raised for mimic_JSON? #290

@RST-J

Description

@RST-J

Hello,
I encountered an issue when using Oj as replacement for the default JSON parser via mimic_JSON which is that error handlers in other code (e.g. other gems) which assume that they have to handle a JSON::ParserError error won't be able to handle the situation as they receive an Oj::ParseError.
So my question is: Wouldn't it be reasonable to raise a JSON::ParserError when mimic_JSON was called instead of Oj's error class? Or, as I don't know about internals, somehow ensure that the raised error is a subclass of JSON::ParserError in this situation?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions