Skip to content

Conversation

@polvalente
Copy link
Contributor

Sometimes, users will try to use invalid combos such as using Torchx as a defn compiler.
This PR transforms the generic FunctionClauseError into a more actionable message.

@polvalente polvalente self-assigned this Jan 28, 2025
defp raise_missing_callback(exception, name, arity, stacktrace) do
case exception do
%UndefinedFunctionError{module: compiler, function: ^name, arity: ^arity} ->
raise ArgumentError,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@josevalim I used ArgumentError because this is directly caused by an invalid option being passed. If you have another suggestion for the exception type, I'm open to it!

polvalente and others added 2 commits January 30, 2025 13:25
Co-authored-by: José Valim <jose.valim@dashbit.co>
@polvalente polvalente merged commit aa366da into main Jan 30, 2025
8 checks passed
@polvalente polvalente deleted the pv-docs/improve-errors-for-missing-callbacks branch January 30, 2025 16:30
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