-
Notifications
You must be signed in to change notification settings - Fork 3.5k
make errors when piping in expressions safer #14795
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
Conversation
For example: If you pasted this into an iex shell, you might have a very very bad day. ```elixir MyApp.Accounts.User |> Ecto.Query.where(user], user.id == 1) # note the missing open bracket |> MyApp.Repo.delete_all() ```
Looks promising! I think you can simplify things a bit. I don't think we need, for example, to repeat the expression, it should be clear it is the one right above. |
Co-authored-by: José Valim <[email protected]>
to handle syntax errors, send to the evaluator to set `iex_error` to `:force` if its set to `:force`, we downgrate it to `true` first.
Okay, I've done some cleanup. I realized we weren't handling syntax errors (i.e errors not coming from evaluating the code) and I had to do something a bit hacky to make that work. I send code to the evaluator to Ready for another look given the simplification and the parse error handling concept. |
One last comment to clean up the interfaces. Do you think we could have some tests? Perhaps in interaction_test.exs? |
Yep, will wrap up and add tests later today or tomorrow 👌 |
Tests added 👍 |
Beautifully done. Will be merged once CI passes! |
💚 💙 💜 💛 ❤️ |
For example:
If you pasted this into an iex shell, you might have a very very bad day.
This is still rough, things I'm not sure about:
In practice it looks like this:
CleanShot.2025-09-27.at.10.31.14.mp4