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

Throw statement in YAMLConfigProvider drops exception on floor #106

Open
davidmichaelkarr opened this issue Aug 17, 2021 · 0 comments
Open

Comments

@davidmichaelkarr
Copy link

I was tracking an error reported by a developer on our team, and the stacktrace included the exception thrown from the following method in "YAMLConfigProvider":

    public void generateConfig(T config, String filePath) throws ConfigurationException {
        YamlWriter writer;
        try {
            writer = new YamlWriter(new FileWriter(filePath));
            writer.getConfig().setClassTag("Configuration", clazz);
            writer.write(Configuration.DEFAULT);
            writer.close();
        } catch (IOException e) {
            throw new ConfigurationException("Configuration Exception", "CONF_002");
        }
    }

That throw statement is dropping the IOException on the floor, which would likely have had information about what file path was being attempted, and that it doesn't exist (I'm making an educated guess from the circumstances of the error that was reported). This throw statement should be fixed to include the caught exception.

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