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 uncaught exception on bad raw text value being encoded #11

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tsloughter
Copy link
Owner

No description provided.

@tsloughter
Copy link
Owner Author

I'm not sure I want to keep the match on error:badarg. I purposely limited it to matching on error:function_clause in order to not sort of hide logic errors in pg_types that are unrelated to what the user's arguments are.

Thinking about it more again I think this does need to change and sadly we just have to keep updating type modules to ensure they'll throw function_clause exceptions (so adding guards) if the user passes args that won't encode properly.

Maybe this won't be as bad if in pgo we also change to actually match on the returned map and in cases it doesn't match that map error expected from pg_types it will continue to raise the exceptions. That way the user won't just get {error, badarg} but a full exception of what went wrong when trying to encode.

Does that make sense @lpil? I'm not sure how Gleam interop works with exceptions?

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.

1 participant