alessandro trinca tornidor
commited on
Commit
·
264ecd7
1
Parent(s):
1c2afc9
[fix] handle multiple exceptions the right way
Browse files
wrappers/fastapi_wrapper.py
CHANGED
@@ -213,7 +213,7 @@ if bool(write_tmp_on_disk):
|
|
213 |
path_write_tmp_on_disk = pathlib.Path(write_tmp_on_disk)
|
214 |
try:
|
215 |
pathlib.Path.unlink(path_write_tmp_on_disk, missing_ok=True)
|
216 |
-
except PermissionError
|
217 |
app_logger.error(f"{err} while removing old write_tmp_on_disk:{write_tmp_on_disk}.")
|
218 |
app_logger.error(f"is file?{path_write_tmp_on_disk.is_file()}.")
|
219 |
app_logger.error(f"is symlink?{path_write_tmp_on_disk.is_symlink()}.")
|
|
|
213 |
path_write_tmp_on_disk = pathlib.Path(write_tmp_on_disk)
|
214 |
try:
|
215 |
pathlib.Path.unlink(path_write_tmp_on_disk, missing_ok=True)
|
216 |
+
except (IsADirectoryError, PermissionError, OSError) as err:
|
217 |
app_logger.error(f"{err} while removing old write_tmp_on_disk:{write_tmp_on_disk}.")
|
218 |
app_logger.error(f"is file?{path_write_tmp_on_disk.is_file()}.")
|
219 |
app_logger.error(f"is symlink?{path_write_tmp_on_disk.is_symlink()}.")
|