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

Report more specific error messages #31

Open
feerrenrut opened this issue Apr 11, 2020 · 2 comments
Open

Report more specific error messages #31

feerrenrut opened this issue Apr 11, 2020 · 2 comments

Comments

@feerrenrut
Copy link

There are many things that may have gone wrong when getting an error such as:
screeninfo.common.ScreenInfoError: No enumerators available

Catching errors and re-raising them from within the enumerators will help to identify the cuase of a problem.

Originally posted by @feerrenrut in https://github.com/rr-/screeninfo/issues/27#issuecomment-612372368

@rr-
Copy link
Owner

rr- commented Apr 11, 2020

The reason why they're caught this way is because screeninfo attempts to use the first available enumerator that succeeds. This should be replaced with checking user's environment such as platform.system() etc.

@feerrenrut
Copy link
Author

Just a suggestion to make debugging eaiser, right now it's a pain. To find out the real error I had to modify the library to actually include the raised exception, even then it wasn't really clear which method in the Windows enumerator had failed, so I had to wrap each of those.

Arguably "no emumerators available" is incorrect, at best misleading. It suggests that the platform isn't supported, or there is no screen rather than an error within one of the enumerators.

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

No branches or pull requests

2 participants