Skip to content

Inconsistent exceptions raised by get() and put() depending on file size #830

Description

@stinos

The DataObjectManager.put method forwards to parallel_put depending on certain conditions but because of the way it handles errors (starting at https://github.com/irods/python-irodsclient/blob/main/irods/manager/data_object_manager.py#L369) the exceptions raised are not necessarily the same as for put without parallel transfer. Moreover depending on what goes wrong, parallel_put raises a differet exception type than put even though from the user's point of view the situation is exactly the same. This makes it rather non-trivial to handle specific exceptions.

For instance when trying to upload data to a path for which there's no collection yet I'm expecting an irods.exception.CAT_UNKNOWN_COLLECTION which I can then handle properly. But with default settings, for a large file put calls into parallel_put and ultimately leads to a RuntimeError with message 'parallel_put failed' being raised.
Note that even if put would not catch exceptions but just raise whatevever parallel_put raises it would still not result in an irods.exception.CAT_UNKNOWN_COLLECTION in this case, but an irods.exception.CollectionDoesNotExist because that is what parallel_put produces.

Similar issues exist for get() / parallel_get(). Didn't check if there are other places where this could also happen.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions