FXGL
FXGL copied to clipboard
when loadUI fails with FileNotFoundException it can not be caught
Describe the bug When loadUI files because of a FileNotFoundException, it does not stop execution nor is there a way to catch it
To Reproduce Steps to reproduce the behavior:
- Inside of the initUI procedure, put this code
UI fxmlUI;
try {
fxmlUI = getAssetLoader().loadUI(new URL("file:///D:/Projects"), controller);
getGameScene().addUI(fxmlUI);
} catch (MalformedURLException e) {
System.out.println("" + e);
System.exit(1);
}
Expected behavior If the URL is properly formed but no existent, the file won't be loaded but the program will continue
Runtime info(please complete the following information):
- OS and version: Windows 10
Sorry for delayed reply, yes, this is by design. We will keep going until we encounter an error we cannot recover from. However, any exceptions should be correctly reported in the log, typically using the WARN tag.