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

Improve error messaging for IOExceptions when loading FXML files #141

Closed
HEdingfield opened this issue Aug 29, 2018 · 5 comments
Closed

Comments

@HEdingfield
Copy link
Contributor

Logger.executionLog(Level.SEVERE, "Failed to open: %s:\n%s", resourcePath, exception.getCause().toString());

The above doesn't show a proper stacktrace; figure out how to improve upon this. Note: it can be triggered for testing by making an error happen in the config creator loadConfig function.

@gngilbert
Copy link
Collaborator

Sounds like this needs to be completed.

@moldover
Copy link
Contributor

@HEdingfield trying to repro/trigger this as part of #271 but I think it may be obsolete. The only place the error message cited above appears in code is in TieBreak.java when it actually fails to load the FXML file, which presumably would only happen if there was some build/packing issue, and not something we need to worry about better user messaging on. I'm inclined to close this, but maybe I'm just missing the use-case. Thanks.

@HEdingfield
Copy link
Contributor Author

I specifically mentioned a lack of stacktrace when this type of error occurs, so do you mean it's now showing a stacktrace when it's triggered (e.g. in the TieBreak.java example)? If so, can probably close, otherwise should probably keep it open.

@moldover
Copy link
Contributor

Gotcha. So when I trigger an IOException (by inserting a syntax error into GuiTiebreakLayout.fxml) I get a pretty reasonable/helpful message:

2019-06-15 10:37:00 PDT SEVERE: Failed to open: /com/rcv/GuiTiebreakerLayout.fxml:
javax.xml.stream.XMLStreamException: ParseError at [row,col]:[20,27]
Message: Attribute name "mnemonicP" associated with an element type "Button" must be followed by the ' = ' character.

The lack of stacktrace is expected since getCause() does not include it, but sounds like this was a problem at the time, so I added it. Did the same at the other callsite. This catches both can't find resource, and problems parsing / loading resource so we should be in good shape.

moldover added a commit that referenced this issue Jun 15, 2019
@HEdingfield
Copy link
Contributor Author

Obsolete / resolved with #287.

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

No branches or pull requests

5 participants