Do not wrap Errors

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Unresolved
    • Priority: Unknown
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Java Drivers
    • None
    • None
    • None
    • None
    • None
    • None

      Everywhere we catch Throwable (we don't explicitly catch Error​s or any subtypes, I checked) in production code, we should make sure that if it's an Error:

      1. It is either re-thrown / put into a Future / fed into a callback (if that's what we do) as is, without being wrapped into anything.
      2. Or, if re-throwing is not supposed to happen, is handled via Thread.currentThread().getThreadGroup().uncaughtException(e, Thread.currentThread()).

      This combined with JAVA-5907 (we replaced submit invocations with execute), JAVA-6109 ensures that the default uncaught exception handler configured by an application will have a chance to handle all Errors that originate from our code. And if there no uncaught exception handler is configured, the Error​s at least will be handled the same way the Java SE handles all uncaught exceptions by default.

      This ticket was created based on this PR comment.

            Assignee:
            Almas Abdrazak
            Reporter:
            Valentin Kavalenka
            None
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: