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

Improve has_many "missing field" error message #480

Merged
merged 2 commits into from
Nov 30, 2019

Conversation

aeneasr
Copy link
Member

@aeneasr aeneasr commented Nov 29, 2019

This patch adds more context to an error that can occur when the target field of a has_many association does not exist on the struct. Before this patch, an error message would look like this:

could not set '467cc7fa-d2f9-4ea7-b943-4dee7f4bddf9' in '<invalid reflect.Value>'

After the patch, it looks like this:

could not set field 'RequestID' in table 'selfservice_login_request_methods' to value '110540dc-e8cc-4587-b391-3114c75c012b' for 'has_many' relation

This patch adds more context to an error that can occur when the target field of a has_many association does not exist on the struct. Before this patch, an error message would look like this:

```
could not set '467cc7fa-d2f9-4ea7-b943-4dee7f4bddf9' in '<invalid reflect.Value>'
```

After the patch, it looks like this:

```
could not set field 'RequestID' in table 'selfservice_login_request_methods' to value '110540dc-e8cc-4587-b391-3114c75c012b' for 'has_many' relation
```

Signed-off-by: aeneasr <aeneas@ory.sh>
@aeneasr aeneasr requested a review from a team as a code owner November 29, 2019 09:36
@aeneasr
Copy link
Member Author

aeneasr commented Nov 29, 2019

@stanislas-m this supersedes #475

@stanislas-m stanislas-m added this to the Next milestone Nov 30, 2019
@stanislas-m stanislas-m merged commit 6e21180 into gobuffalo:development Nov 30, 2019
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.

None yet

2 participants