Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions cs3client/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@


from .config import Config
from .exceptions import AuthenticationException, FileLockedException
from .exceptions import AuthenticationException, FileLockedException, NotFoundException
from .cs3resource import Resource
from .statuscodehandler import StatusCodeHandler

Expand Down Expand Up @@ -226,6 +226,7 @@ def write_file(
else:
headers = {
"Upload-Length": str(size),
"Content-Length": str(size),
"X-Reva-Transfer": protocol.token,
**dict([auth_token]),
"X-Lock-Id": lock_id,
Expand Down Expand Up @@ -318,7 +319,10 @@ def read_file(self, auth_token: tuple, resource: Resource, lock_id: Optional[str
f'msg="Error downloading file from Reva" code="{fileget.status_code}" '
f'reason="{status_msg}"'
)
raise IOError(fileget.reason)
if fileget.status_code == http.client.NOTFOUND:
raise NotFoundException
else:
raise IOError(fileget.reason)
else:
self._log.info(
f'msg="File open for read" {resource.get_file_ref_str()} elapsedTimems="{(tend - tstart) * 1000:.1f}"'
Expand Down