Skip to content

Error code for invalid JSON literal? #149

Closed
@davidlehn

Description

@davidlehn

How should errors be handled when fromRdf tries to parse an invalid JSON literal? I'm not sure if one of the current error codes [1] is appropriate or if an "invalid JSON literal" or similar code should be added. I added that and a test in the jsonld.js JSON literal patch [2], but it's an ad-hoc code and the API spec and tests should probably specify what to do.

[1] https://w3c.github.io/json-ld-api/#jsonlderrorcode
[2] digitalbazaar/jsonld.js#325

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions