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

Make anyTranscodeFailure more descriptive #1527

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

rebello95
Copy link
Contributor

@rebello95 rebello95 commented Dec 22, 2023

Right now it's quite difficult to identify which type is missing from the Google_Protobuf_Any registry when the anyTranscodeFailure is thrown without having Xcode and breakpoints to debug the program. This change makes the error more descriptive and actionable by including the type URL that needs to be registered.

Errors now look like this:

Swift/ErrorType.swift:200: Fatal error: Error raised at top level: SwiftProtobuf.BinaryEncodingError.anyTypeURLNotRegistered(typeURL: "type.googleapis.com/connectrpc.conformance.v1.IdempotentUnaryRequest")

Right now it's quite difficult to identify _which type_ is missing from the `Google_Protobuf_Any` registry when the `anyTranscodeFailure` is thrown without having Xcode and breakpoints to debug the program. This change makes the error more descriptive and actionable by including the type URL that needs to be registered.
@thomasvl
Copy link
Collaborator

thomasvl commented Jan 2, 2024

Forgot to mention, I'm good with this change, it's fine on main because we're working towards 2.x there, so changing the errors is safe.

@tbkka - you good with this change to the errors?

@tbkka
Copy link
Collaborator

tbkka commented Jan 3, 2024

Yeah, this is a nice improvement, but definitely needs to be held for 2.x.

@thomasvl thomasvl merged commit a266c55 into apple:main Jan 3, 2024
9 checks passed
@thomasvl
Copy link
Collaborator

thomasvl commented Jan 3, 2024

Thanks for the patch!

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.

3 participants