python-irodsclient icon indicating copy to clipboard operation
python-irodsclient copied to clipboard

Make error-passing interface more uniform

Open alanking opened this issue 1 year ago • 1 comments

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.

Originally posted by @d-w-moore in https://github.com/irods/python-irodsclient/issues/518#issuecomment-1960868305

alanking avatar Apr 25 '24 18:04 alanking

wait for the Python3-only future

seems good.

trel avatar Apr 25 '24 18:04 trel