You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEA]: if_not_found flag for all pathfinder APIs? #1954
Is your feature request related to a problem? Please describe.
If a library / binary / header is not found, the default behavior for pathfinder is to return None. This leaves the exception handling to users. User would either: 1) search on their own, 2) further raise the issue. Writing the custom error message for the library isn't particularly easy (basically directing user to install the right package) so it would be nice to also handle that inside the pathfinder library.
Basically, I suggest a if_not_found={"raise", "return_none"} flag, that either raises or returns None when a library isn't found. When raise is set and a library isn't found, a PathfinderNotFound exception is raised, with specific error message directing user to install the missing package.
Writing the custom error message for the library isn't particularly easy (basically directing user to install the right package)
Yes, that's why I didn't want to get into it when I was first adding the header directory search. Currently we're not keeping track of where we're searching. It's indeed a non-trivial project to produce meaningful exceptions. I'll revisit this after I'm done with the compatibility check work (similar to #1038).
Activity
rwgk commentedon Apr 20, 2026
Yes, that's why I didn't want to get into it when I was first adding the header directory search. Currently we're not keeping track of where we're searching. It's indeed a non-trivial project to produce meaningful exceptions. I'll revisit this after I'm done with the compatibility check work (similar to #1038).