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

Fix incorrect error for decimal encoding #95

Conversation

jbruggem
Copy link
Contributor

@jbruggem jbruggem commented Apr 8, 2024

When handling errors in AvroEx.Encode, I made a mistake when calling error/1: it's supposed to be called with arguments supported by AvroEx.DecodeError.new/1.

This PR adds a test and fixes the mistake.

@jbruggem jbruggem requested a review from a team as a code owner April 8, 2024 09:44
Comment on lines +36 to +40
def new({:incompatible_decimal, expected_scale, actual_scale}) do
%__MODULE__{
message: "Incompatible decimal: expected scale #{expected_scale}, got #{actual_scale}"
}
end
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@davydog187 is it the right approach here to add a new type of error ?

@davydog187 davydog187 merged commit 70c8337 into beam-community:master Apr 8, 2024
2 checks passed
@davydog187
Copy link
Member

Thanks 🥳

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