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

Unwrap InvocationTargetException which are ResponseErrorException #809

Merged
merged 3 commits into from
Feb 29, 2024

Commits on Feb 20, 2024

  1. Unwrap InvocationTargetException which are ResponseErrorException

    By wrapping ResponseErrorException with another layer in
    RuntimeException it means the unwrapping of the exception in
    RemoteEndpoint.DEFAULT_EXCEPTION_HANDLER doesn't work as
    expected and instead of getting the original ResponseError
    the other end gets the fallback ResponseError of type
    internal error.
    
    This change includes updates to documentation to show that
    it is ok to throw ResponseErrorException (reverts #578).
    While it is also OK to return an exceptionally completed
    future, it is not needed to do that way and simply throwing
    is more straightforward.
    
    There are new tests to cover the changed handling. Also tested
    is the previously documented way of handling exceptions (see
    `tries == 1` case in `testVersatility` and `testVersatilityResponseError`
    
    Fixes #802
    
    Also-by: Vladimir Piskarev <pisv@1c.ru>
    jonahgraham committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    aa092c0 View commit details
    Browse the repository at this point in the history
  2. Use more specific exception when @JsonDelegates throw an exception

    This exception is thrown when the endpoint is created, not as a result of
    a receiving a message. This is generally a coding error, so make this
    exception the same as the other exceptions thrown by recursiveFindRpcMethods.
    
    Included is adding additional tests to ensure coverage of some
    previously missing uses cases.
    
    Code cleanup done as part of #802
    jonahgraham committed Feb 20, 2024
    Configuration menu
    Copy the full SHA
    aa0bb9e View commit details
    Browse the repository at this point in the history

Commits on Feb 29, 2024

  1. Treat checked exceptions from jsonrpc methods as unexpected

    Checked exceptions should not be thrown from annotated jsonrpc methods.
    Such exceptions can be treated as a programming error, and signaled via
    an IllegalStateException in the GenericEndpoint.
    
    An inaccessible jsonrpc method can be handled in a similar way.
    
    For detailed discussion and context, see
    #809 (comment).
    pisv committed Feb 29, 2024
    Configuration menu
    Copy the full SHA
    3982fd3 View commit details
    Browse the repository at this point in the history