-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[Error printing] Distinguish having no applicable function and manually thrown MethodErrors #36182
Labels
error handling
Handling of exceptions by Julia or the user
Comments
The |
vtjnash
added a commit
that referenced
this issue
Feb 1, 2024
Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182
vtjnash
added a commit
that referenced
this issue
Feb 1, 2024
Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182
vtjnash
added a commit
that referenced
this issue
Feb 1, 2024
Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182
vtjnash
added a commit
that referenced
this issue
Feb 1, 2024
Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182
vtjnash
added a commit
that referenced
this issue
Feb 3, 2024
Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182
vtjnash
added a commit
that referenced
this issue
Feb 5, 2024
Distinguish some of the cases of manually thrown MethodError by looking for a method in the specified world. Also refactor some of the kwcall handling to be closer to supporting `invoke`d calls (although it does not guaranteed to have a value for `f`, which is often required later). Fixes #36182
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In order to progress on the long way to perfect, beautiful and userfriendly error messages and to reduce irritations like those:
(This particular error has already a bug report there #34519)
where it clearly looks like there are applicable methods and in fact are, I'd suggest to somehow leverage that information for the user that there indeed are functions which have compatible signature but can't handle that actual signature.
Every time I stumble over such a case I first check it like 3 times whether I overlooked something in the signature but come to the conclusion that it should find its applicable function. Once I dive into the function via
@edit
I see that a MethodError was thrown manually.At the very least it looks somewhat inconsistent to me. An idea to tackle that problem would be to introduce a
manual
flag (naming of that flag is open to discussion) which can be passed to theMethodError
constructor and istrue
by default. Only in the places where the MethodError is thrown because there are no applicable methods at all, that flag should hold the valuefalse
. Then, on printing the error, we could easily distinguish those cases.Even though the steps to solve that error are the same in both cases, namingly, defining the missing function, it helps reducing confusion and increases consistency IMO.
The text was updated successfully, but these errors were encountered: