Commit 69febc23 by rfkelly0

check for PermissionDeniedError in DAVFS.open() (issue #32)

parent f38dc77b
...@@ -285,9 +285,12 @@ class DAVFS(FS): ...@@ -285,9 +285,12 @@ class DAVFS(FS):
raise ResourceNotFoundError(path) raise ResourceNotFoundError(path)
contents = "" contents = ""
self.setcontents(path,contents) self.setcontents(path,contents)
elif contents.status in (401,403):
contents.close()
raise PermissionDeniedError("open")
elif contents.status != 200: elif contents.status != 200:
contents.close() contents.close()
raise_generic_error(resp,"open",path) raise_generic_error(contents,"open",path)
elif self.isdir(path): elif self.isdir(path):
raise ResourceInvalidError(path) raise ResourceInvalidError(path)
if mode == "r-": if mode == "r-":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment