spkrepo
spkrepo copied to clipboard
Improve error handling for FileExistsError
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'