Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove IOException from JsonLoader.fromString() #7

Open
phillipjohnson opened this issue Jul 21, 2015 · 0 comments
Open

Remove IOException from JsonLoader.fromString() #7

phillipjohnson opened this issue Jul 21, 2015 · 0 comments

Comments

@phillipjohnson
Copy link

Here's the relevant code:

/**
     * Read a {@link JsonNode} from a string input
     *
     * @param json the JSON as a string
     * @return the document
     * @throws IOException could not read from string
     */
    public static JsonNode fromString(final String json)
        throws IOException
    {
        return fromReader(new StringReader(json));
    }

I can't think of any reason why a String operation would throw an IO Exception and the JavaDoc doesn't clarify it either.

If I jump back to the JsonNodeReader.fromReeader there's a hint that an IO Exception could be thrown for malformed input. Perhaps a custom exception would be better suited?

@phillipjohnson phillipjohnson changed the title Remove IOExcpetion from JsonLoader.fromString() Remove IOException from JsonLoader.fromString() Jul 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant