Skip to content

Commit 53e0728

Browse files
author
Andrei Neagu
committed
renaming error
1 parent be58b0c commit 53e0728

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

packages/service-library/src/servicelib/archiving_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class ArchiveError(Exception):
3535
"""
3636

3737

38-
class UnsupportedArchiveFormat(Exception):
38+
class UnsupportedArchiveFormatError(Exception):
3939
pass
4040

4141

@@ -266,7 +266,7 @@ async def unarchive_dir(
266266
)
267267
# maybe write unsupported error format here instead of all this to be able to still raise in case of error
268268
if isinstance(err, NotImplementedError):
269-
raise UnsupportedArchiveFormat(msg) from err
269+
raise UnsupportedArchiveFormatError(msg) from err
270270

271271
raise ArchiveError(msg) from err
272272

services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules/nodeports.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from pydantic import ByteSize
2323
from servicelib.archiving_utils import (
2424
PrunableFolder,
25-
UnsupportedArchiveFormat,
25+
UnsupportedArchiveFormatError,
2626
archive_dir,
2727
unarchive_dir,
2828
)
@@ -281,10 +281,12 @@ async def _get_data_from_port(
281281
if not downloaded_file or not downloaded_file.exists():
282282
# the link may be empty
283283
# remove files all files from disk when disconnecting port
284-
_logger.debug("removing contents of dir %s", final_path)
285-
await remove_directory(
286-
final_path, only_children=True, ignore_errors=True
287-
)
284+
with log_context(
285+
_logger, logging.DEBUG, f"removing contents of dir '{final_path}'"
286+
):
287+
await remove_directory(
288+
final_path, only_children=True, ignore_errors=True
289+
)
288290
return port, None, ByteSize(0)
289291

290292
transferred_bytes = downloaded_file.stat().st_size
@@ -307,7 +309,7 @@ async def _get_data_from_port(
307309
dest_folder.prune(exclude=unarchived)
308310

309311
_logger.debug("all unzipped in %s", final_path)
310-
except UnsupportedArchiveFormat:
312+
except UnsupportedArchiveFormatError:
311313
_logger.warning(
312314
"Could not extract archive '%s' to '%s' moving it to: '%s'",
313315
downloaded_file,

0 commit comments

Comments
 (0)