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

full error message #155

Closed
wants to merge 1 commit into from
Closed

full error message #155

wants to merge 1 commit into from

Conversation

anvlkv
Copy link
Contributor

@anvlkv anvlkv commented Nov 16, 2023

Current errors from typegen can get very puzzling, as e.explanation() doesn't mention concrete types which caused the error.

Example of error message before the change:

TypeTracing("\nTwo formats computed for the same entity do not match. This can happen if custom implementations of\nthe Serialize and Deserialize traits do not agree, e.g. if one uses `Vec<u8>` and the other one uses `&[u8]`\n(implying bytes) --- see the crate `serde_bytes` for more context in this particular example.\n\nVerify the implementations of Serialize and Deserialize for the given format.\n")

This PR adds full error message to tracing and deserialization errors.

Here's an example error message with this change:

TypeTracing("Incompatible formats detected: TypeName(\"KeyValueOperation\") TypeName(\"NavigateOperation\"): \nTwo formats computed for the same entity do not match. This can happen if custom implementations of\nthe Serialize and Deserialize traits do not agree, e.g. if one uses `Vec<u8>` and the other one uses `&[u8]`\n(implying bytes) --- see the crate `serde_bytes` for more context in this particular example.\n\nVerify the implementations of Serialize and Deserialize for the given format.\n")

@StuartHarris
Copy link
Member

Thank you so much for this! I just ran rustfmt and pushed, but looks good to me! 👍

@StuartHarris
Copy link
Member

My apologies, I merged this in another PR as my formatting commit seemed to go to the wrong place. Anyway, it's merged now! Thanks for the contribution!

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