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

Fix not to raise an exception from `(Service|Client)RequestContext.cu… #2962

Merged
merged 2 commits into from Aug 3, 2020

Commits on Aug 3, 2020

  1. Fix not to raise an exception from `(Service|Client)RequestContext.cu…

    …rrentOrNull()`
    
    Motivation:
    `ServiceRequestContext.currentOrNull()` raises an `IllegalArgumentException`
    if the current ctx is `ClientRequestContext` and `ctx.root()` returns `null`.
    
    It's very confusing because all other APIs returns `null` if the name ends with `orNull`.
    So I think the API should return `null` instead of raising an exception.
    We could use `ClientRequestContext.roo()` to find out if the client call is invoked by a server request or not.
    
    Modification:
    - Returns `null` instread of raising an exception from `(Service|Client)RequestContext.currentOrNull()`
    
    Result:
    - `(Service|Client)RequestContext.currentOrNull()` does not throw an exception anymore.
    minwoox committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    86ddd1c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d176bea View commit details
    Browse the repository at this point in the history