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

FeatureFileDumper main method could handle exceptions better #18

Open
davidmoten opened this issue Jan 12, 2015 · 2 comments
Open

FeatureFileDumper main method could handle exceptions better #18

davidmoten opened this issue Jan 12, 2015 · 2 comments

Comments

@davidmoten
Copy link

The main method in FeatureFileDumper catches exceptions and writes to System.err but does not exit the process with a non-zero exit code nor throw a RuntimeException. One of these should occur.

        try {
            ...
        } catch (IOException ioe) {
            System.err.println("I/O Error " + ioe);
        } catch (PropertyException p) {
            System.err.println("Bad configuration " + p);
        }
@nshmyrev
Copy link
Contributor

Thank you for your report. In processing large databases it's ok to have issues. Stopping the work is not a good idea the, it's better to warn and proceed. The filedumper needs rewokr though.

@davidmoten
Copy link
Author

I agree that sometimes the caller would want problems to be ignored but it
should be up to the caller to do the ignoring (or not ignore). Putting
output to stderr only is not a great way of signaling a problem in my
opinion.

My reading indicates that the consensus for main method usage is to call
System.exit as the main method is expected to be called from scripts rather
than Java code. Scripts can ignore errors if they want to.
On 13 Jan 2015 08:14, "Nickolay V. Shmyrev" [email protected]
wrote:

Thank you for your report. In processing large databases it's ok to have
issues. Stopping the work is not a good idea the, it's better to warn and
proceed. The filedumper needs rewokr though.


Reply to this email directly or view it on GitHub
#18 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants