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

Connection.__init__ no longer raises iRODS error code exceptions #518

Closed
alanking opened this issue Feb 22, 2024 · 2 comments
Closed

Connection.__init__ no longer raises iRODS error code exceptions #518

alanking opened this issue Feb 22, 2024 · 2 comments
Assignees
Milestone

Comments

@alanking
Copy link
Contributor

In the past, instantiating a Connection object with invalid credentials for authentication would result in an iRODS error code being raised (e.g. PAM_AUTH_PASSWORD_FAILED or CAT_INVALID_USER). Now, any failed authentication causes ValueError to be raised and the "reason" for the failed authentication is lost.

The relevant code change can be found here: 8956644#diff-65db2a2628890f6590ada70f47840fedb056dec02a3e0e61e27a339bea7514d2R80-R89

I'm using the bug label, but this may be intentional and we should write down why this change has occurred if it is expected.

@d-w-moore
Copy link
Collaborator

d-w-moore commented Feb 23, 2024

If there were a valid reason for masking the original server-given exception types and codes, it might be to add some consistency to the client interface, as @alanking noted in e-mail discussions today. We should discuss the pros and cons of that here, perhaps, but I'll just note that perhaps we should then:

  • wait for the Python3-only future
  • use the raise-from syntax to transform those errors into something "more consistent". This sets the __cause__ attribute to preserve the original exception.
  • use an Exception type other than ValueError as our error indicator; it's too broad, though probably appropriate in the original usage to identify an invalid scheme here.

@alanking
Copy link
Contributor Author

I created #545 for considering how to make the errors more uniform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants