Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace "handle" with "tryHandle" for uncaught exceptions #3554

Draft
wants to merge 8 commits into
base: develop
Choose a base branch
from

Commits on Dec 16, 2022

  1. Configuration menu
    Copy the full SHA
    573001d View commit details
    Browse the repository at this point in the history
  2. Use ANDROID_DETECTED

    dkhalanskyjb committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    df029ff View commit details
    Browse the repository at this point in the history
  3. Improve comments

    dkhalanskyjb committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    30e1f02 View commit details
    Browse the repository at this point in the history
  4. Fix apiDump

    dkhalanskyjb committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    fbc50da View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    7c627da View commit details
    Browse the repository at this point in the history
  6. Add tests

    dkhalanskyjb committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    c4345c5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    7695863 View commit details
    Browse the repository at this point in the history
  8. Replace "handle" with "tryHandle" for uncaught exceptions

    I find this to be a much clearer mental model.
    * A handler can decide if it can process this particular exception.
    * A handler can be in an invalid state, and it can now pass
      handling the uncaught exception to the system, without making
      additional noise.
    * Before this change, there are *two* types of exception handlers:
      - Those that are used as coroutine context elements.
        If a coroutine context element processes an exception
        successfully, the system is not notified about them.
      - Those that are used as services.
        These are just notified about exception, they are not
        considered to be consuming them. I guess this was done for
        the sake of Android's pre-handler.
    
    If we forget about backward compatibility, I'm certain this is the
    way to do it, but I don't see a good way to make this change while
    staying backward-compatible.
    dkhalanskyjb committed Dec 16, 2022
    Configuration menu
    Copy the full SHA
    223c578 View commit details
    Browse the repository at this point in the history