Skip to content

Handle invalid string in Json file #937

@arunpkio

Description

@arunpkio

Bug Report

  • I am using the following code load a JSON file. I want to handle the error cases if the JSON is wrong or corrupted. How do I handle or get to know if the JSON I am trying to load is with correct syntax or not.
    std::ifstream presetfile(presetName); json jsobject; jsobject << presetfile;

  • Use a simple JSON file and add any character at the beginning of the JSON like "test" in the first line. Then try to load the file using the above code we can see a crash.

  • I would like to see the information that the JSON that I am trying to load is corrupted/not in the expected format with a line where the issue is[optionally].

  • Is simply crashes.

  • I use Clang

  • released

  • No compile error

Metadata

Metadata

Assignees

No one assigned

    Labels

    solution: proposed fixa fix for the issue has been proposed and waits for confirmation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions