sarutak opened a new pull request, #2416:
URL: https://github.com/apache/avro/pull/2416
AVRO-3823
## What is the purpose of the change
This PR fixes an issue that the current Rust binding doesn't show helpful
error messages.
Actually, error types are implemented with helpful error messages.
This is an example.
```
#[error("No `name` field")]
GetNameField,
```
But those error messages are not shown.
Given we try to a invalid schema which contains no name field, we expect to
get ```No `name` field``` but the actual is `GetNameFIeld`, which makes it
difficult for users to resolve the problem.
The cause is that when an error is return from `main`, the error message is
made by `Debug::fmt` instead of `Display::fmt`.
So, the solution is implemented `Debug` trait for errors manually.
## Verifying this change
Tested manually with the following schemas.
```
{
"type": "record",
"fields": []
}
Error: No `name` field
```
```
{
"name": "my_schema",
"type": "record",
"fields": [
}
Error: Failed to parse schema from JSON: expected value at line 5 column 1
```
## Documentation
No new feature added.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]