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

Preserve serializable custom errors from remote method calls. #458

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

ghemawat
Copy link
Collaborator

The code generator emits code to keep track of all error types that contain an embedded weaver.AutoMarshal in a global table. The sender sends such errors by prefixing their serialization with they corresponding key in the global table. The receiver looks up the key in its global table, creates a value of the correct type, and deserializes the error contents into that value.

This allows custom errors to be returned from remote methods without losing type information.

The code generator emits code to keep track of all error types that
contain an embedded weaver.AutoMarshal in a global table.  The sender
sends such errors by prefixing their serialization with they
corresponding key in the global table. The receiver looks up the
key in its global table, creates a value of the correct type,
and deserializes the error contents into that value.

This allows custom errors to be returned from remote methods without
losing type information.
@ghemawat ghemawat requested a review from mwhittaker July 13, 2023 22:40
Copy link
Contributor

@spetrovic77 spetrovic77 left a comment

Choose a reason for hiding this comment

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

Looks great!

website/docs.md Outdated Show resolved Hide resolved
website/docs.md Outdated Show resolved Hide resolved
@ghemawat
Copy link
Collaborator Author

Thanks!

@ghemawat ghemawat merged commit 3f2b58a into ServiceWeaver:main Jul 14, 2023
7 checks passed
@ghemawat ghemawat deleted the register branch July 14, 2023 23:42
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