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

Split up DiscError #47

Open
Freso opened this issue Mar 6, 2017 · 1 comment
Open

Split up DiscError #47

Freso opened this issue Mar 6, 2017 · 1 comment

Comments

@Freso
Copy link
Collaborator

Freso commented Mar 6, 2017

Right now the DiscError exception is being called for any issue with reading the disc, e.g., including there not being a disc drive at all or the user not having permission to access it. It would be nice if at least these two (no drive, no permissions) could be handled by their own exceptions.

@JonnyJD
Copy link
Owner

JonnyJD commented Mar 6, 2017

Well, libdiscid only has the two options success or failure and on failure there is a function to get the error message.
We would then need to parse the error message (which is not necessarily the same on all platforms, as are the reasons for failure) and based on that raise different exceptions.
That's for "no drive". Even the libdiscid code doesn't when something is not working due to permissions. (It just doesn't work in terms of libdiscid code). Now it would be possible to add some code to libdiscid to also check for that (for all platforms), but I don't think I would have time for that.

So I don't see that happen :-/
I would accept patches for python-discid though if anybody wants to check the libdiscid code, note down all error messages, and add some "detection" code to python-discid.
This would be a bit hacky, but could in theory work backwards compatible when the new Exception is a subclass of 'DiscError'.

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