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

Return exception instead of string #651

Conversation

Jhonatannunessilva
Copy link
Contributor

This PR resolves #646

After this PR, the error_message/1 function will return an exception instead of a string.

- Compiler message: "error: variables can be used directly in the `format!` string"
- Now, this function will return an exception instead of a string
@Jhonatannunessilva
Copy link
Contributor Author

Which typespecs should change?

Because from what I saw the functions error_message/1, apply/2, apply_series/3, apply_dataframe/3, and apply_dataframe/4 do not have typespecs.

@josevalim
Copy link
Member

I think entries like this: https://github.com/elixir-explorer/explorer/blob/main/lib/explorer/data_frame.ex#L537

Should now say {:error, Exception.t}, no?

@josevalim josevalim merged commit 9588610 into elixir-explorer:main Jul 18, 2023
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

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.

Normalise errors to return Exception.t() from the backend
2 participants