Skip to content

Instantly share code, notes, and snippets.

@carlosanders
Created January 26, 2018 00:53
Show Gist options
  • Select an option

  • Save carlosanders/266be651a6eed5d76dd626a4013bb0d2 to your computer and use it in GitHub Desktop.

Select an option

Save carlosanders/266be651a6eed5d76dd626a4013bb0d2 to your computer and use it in GitHub Desktop.
...
catch (Exception e) {
// e.printStackTrace();
throw e;
// throw new Exception(e);
}
...
copyWorker.setOnFailed(evt -> {
System.out.println("Task failed!");
if (copyWorker.getException() instanceof IndexOutOfBoundsException) {
System.out.println("...with an IndexOutOfBoundsException");
} else if (copyWorker.getException() instanceof NumberFormatException) {
System.out.println("...with a NumberFormatException");
} else {
System.out.println("...with another, unexpected execption");
}
Optional<ButtonType> result = Helper.enviarPergunta(AlertType.ERROR, "Ocorreu um Erro",
"Houve um erro na verificação do arquivo!",
"Mensagem: " + copyWorker.getException().getLocalizedMessage());
if (result.get() == ButtonType.OK) {
editMode.set(true);
modeTask.set(true);
btnVrfFile.disableProperty().bind(editMode.not());
btnSelectFile.disableProperty().bind(editMode.not());
progress.progressProperty().unbind();
progress.setProgress(0);
}
System.out.println(copyWorker.getException().getLocalizedMessage());
System.out.println(copyWorker.getException().getCause());
System.out.println(copyWorker.getException().getStackTrace());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment