Created
January 26, 2018 00:53
-
-
Save carlosanders/266be651a6eed5d76dd626a4013bb0d2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ... | |
| 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