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

5.1.0 changes status exception behaviour #371

Closed
bjoernmayer opened this issue Aug 10, 2023 · 6 comments
Closed

5.1.0 changes status exception behaviour #371

bjoernmayer opened this issue Aug 10, 2023 · 6 comments
Labels
bug Auto-generates notes
Milestone

Comments

@bjoernmayer
Copy link

bjoernmayer commented Aug 10, 2023

Hey there,

we recently tried to update from v5.0.0 to v5.1.0.

Unfortunately, the status exception handling changed behaviour in this release.

At some point in the code we throw an IllegalArgumentException. Then catch it, and map it to a StatusException:

fun IllegalArgumentException.toGrpcFailedPreconditionException(): StatusException =
    Status.FAILED_PRECONDITION
        .withCause(this)
        .withDescription("Milk is expired")
        .asException()

This exception is then thrown in our grpc service.

We would expect this response:

ERROR:
  Code: FailedPrecondition
  Message: Milk is expired

The actual output is:

ERROR:
  Code: Internal
  Message: 

Wild guess: This one might cause this: #344

@jvmlet
Copy link
Collaborator

jvmlet commented Aug 10, 2023

Which log messages do you see from this class ?

@bjoernmayer
Copy link
Author

bjoernmayer commented Aug 10, 2023

Closing call with Status{code=INTERNAL, description=null, cause=null}

Important to notice: The exception being thrown is not a RuntimeException.

@jvmlet
Copy link
Collaborator

jvmlet commented Aug 10, 2023

Closing call with Status{code=INTERNAL, description=null, cause=null}

This is THE ONLY log you see ?

@bjoernmayer
Copy link
Author

Yep. I even activated debug log level for org.lognet.springboot.grpc

@jvmlet jvmlet added the backwards-incompatible Auto-generates notes label Aug 14, 2023
@jvmlet jvmlet added this to the 5.1.5 milestone Aug 14, 2023
@jvmlet jvmlet added bug Auto-generates notes and removed backwards-incompatible Auto-generates notes labels Aug 14, 2023
@jvmlet jvmlet closed this as completed in b6f9a75 Aug 14, 2023
@jvmlet
Copy link
Collaborator

jvmlet commented Aug 14, 2023

Please try with latest 5.1.5-SNAPSHOT

@jvmlet
Copy link
Collaborator

jvmlet commented Sep 27, 2023

5.1.5 was released

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Auto-generates notes
Projects
None yet
Development

No branches or pull requests

2 participants