spkrepo icon indicating copy to clipboard operation
spkrepo copied to clipboard

Improve error handling for FileExistsError

Open ymartin59 opened this issue 4 years ago • 0 comments

When publish fails or version already exists on disk:

[2020-07-26 08:33:20 +0000] [9] [ERROR] Error handling request /packages
Traceback (most recent call last):
  File "/usr/src/app/spkrepo/views/api.py", line 261, in post
    os.mkdir(os.path.join(data_path, package.name, str(version.version)))
FileExistsError: [Errno 17] File exists: '/data/dnscrypt-proxy/5'

[Traceback...]

  File "/usr/src/app/spkrepo/views/api.py", line 278, in post
    abort(500, message="Failed to save files", details=e.message)
AttributeError: 'FileExistsError' object has no attribute 'message'

ymartin59 avatar Jul 26 '20 09:07 ymartin59