Skip to content

No UncaughtExceptionHandler/onFailed method for Tasks #1276

Closed

Description

@JaniruTEC

Description

Some implementations of javafx.concurrent.Task in the Cryptomator project don't have something similar to an UncaughtExceptionHandler of java.lang.Thread. This causes exceptions - that haven't been caught in the Runner-Thread - to be neither logged nor handled, which makes debugging difficult.
Generally speaking the following design decision leads to problems: Thread has a default UncaughtExceptionHandler that prints a stacktrace if a Thread terminates with an exception. Task suppresses the exception fully.

System Setup

  • Operating system and version: Any
  • Cryptomator version: 1.6.0-SNAPSHOT (Internal)
  • Volume type: Any

Recommended Course of Action

Use a combination of setOnFailed() and getException() to create an UncaughtExceptionHandler for Tasks.
See for reference:

task.setOnFailed(evt -> LOG.error("Failed to lock vaults " + vaultNames, evt.getSource().getException()));

Activity

  1. added
    state:confirmed
    on Jul 17, 2020
  2. added this to the 1.5.7 milestone on Aug 6, 2020
  3. modified the milestones: 1.5.7, , 1.5.8 on Aug 11, 2020
  4. modified the milestones: 1.5.8, 1.5.9 on Aug 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

misc:filesystemstate:confirmed

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions