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

Raise a nice error message of params is not a list #714

Merged

Conversation

greg-rychlewski
Copy link
Member

@greg-rychlewski greg-rychlewski commented Nov 6, 2024

This can help if the user is passing a single value as a parameter or something like that. Otherwise the function clause error can be a bit cryptic.

@wojtekmach
Copy link
Member

WDYT about adding is_list(params) to Postgrex.query, execute, and similar functions? We’d still get no function clause error but I believe it would be a more relevant error message. But ArgumentError is fine too though I’d consider raising it from that query and friends, I think shorter stacktrace is preferred.

@greg-rychlewski
Copy link
Member Author

Good point! Changed.

@greg-rychlewski
Copy link
Member Author

merge conflicts =/ will fix

@greg-rychlewski
Copy link
Member Author

ok all better now

@greg-rychlewski greg-rychlewski merged commit 66325e4 into elixir-ecto:master Nov 6, 2024
9 checks passed
@greg-rychlewski greg-rychlewski deleted the params_error_msg branch November 6, 2024 12:57
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.

3 participants