Skip to content

Add exception to metadata interceptors on_end#149

Merged
anuraaga merged 2 commits intoconnectrpc:mainfrom
anuraaga:error-metadata
Mar 3, 2026
Merged

Add exception to metadata interceptors on_end#149
anuraaga merged 2 commits intoconnectrpc:mainfrom
anuraaga:error-metadata

Conversation

@anuraaga
Copy link
Collaborator

@anuraaga anuraaga commented Mar 3, 2026

Realized while starting OTel middleware - while metadata interceptors aren't meant to support any type of interception, a logging interceptor was definitely in mind when defining them, and that would need access to any raised exceptions.

@anuraaga anuraaga requested a review from a team March 3, 2026 02:22
Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
@anuraaga anuraaga changed the title Pass exception to metadata interceptors Add exception to metadata interceptors on_end Mar 3, 2026
await client_async.make_hat(Size(inches=-10))
assert (
interceptor.result
== ["Hello MakeHat and goodbye with error Size must be non-negative"] * 2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need more coffee, but why are all of these * 2 again?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had the same question actually when working on this. Split up the server / client interceptor

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, now that makes sense!

Signed-off-by: Anuraag Agrawal <anuraaga@gmail.com>
@anuraaga anuraaga merged commit 00b5efd into connectrpc:main Mar 3, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants