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

Do not raise on unsuccessful cast #156

Merged
merged 5 commits into from
Apr 30, 2024

Conversation

marmor157
Copy link
Contributor

@marmor157 marmor157 commented Mar 22, 2023

Currently when there's invalid value(such as empty string) given to the Geo.PostGIS.Geometry.case it raises.

It's not a perfect solution if we want to use this function when parsing data that comes from outside of the system, like GraphQL request.

To make it more friendly to use I've made so that on unsuccessful cast returns :error instead of raising.

@zolrath
Copy link

zolrath commented Apr 24, 2024

I'd love to see the ability to return a Changeset error on an unsuccessful cast!

Copy link
Collaborator

@s3cur3 s3cur3 left a comment

Choose a reason for hiding this comment

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

This is a great change! One minor nit and I think we should ship it. ☺️

lib/geo_postgis/geometry.ex Outdated Show resolved Hide resolved
Copy link
Collaborator

@s3cur3 s3cur3 left a comment

Choose a reason for hiding this comment

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

Tests pass, and the changes make sense. 👍

@s3cur3 s3cur3 merged commit 260290e into felt:master Apr 30, 2024
19 checks passed
@s3cur3
Copy link
Collaborator

s3cur3 commented Apr 30, 2024

Thanks so much, @marmor157! 😄 💜

@s3cur3
Copy link
Collaborator

s3cur3 commented May 8, 2024

Included in the newly published v3.7.0 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants