File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed
packages/service-library/src/servicelib
services/dynamic-sidecar/src/simcore_service_dynamic_sidecar/modules Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ class ArchiveError(Exception):
3535 """
3636
3737
38+ class UnsupportedArchiveFormat (Exception ):
39+ pass
40+
41+
3842def _human_readable_size (size , decimal_places = 3 ):
3943 human_readable_file_size = float (size )
4044 unit = "B"
@@ -260,6 +264,10 @@ async def unarchive_dir(
260264 f"Failed unarchiving { archive_to_extract } -> { destination_folder } due to { type (err )} ."
261265 f"Details: { err } "
262266 )
267+ # maybe write unsupported error format here instead of all this to be able to still raise in case of error
268+ if isinstance (err , NotImplementedError ):
269+ raise UnsupportedArchiveFormat (msg ) from err
270+
263271 raise ArchiveError (msg ) from err
264272
265273 # NOTE: extracted_paths includes all tree leafs, which might include files and empty folders
Original file line number Diff line number Diff line change 2121from models_library .services_types import ServicePortKey
2222from pydantic import ByteSize
2323from servicelib .archiving_utils import (
24- ArchiveError ,
2524 PrunableFolder ,
25+ UnsupportedArchiveFormat ,
2626 archive_dir ,
2727 unarchive_dir ,
2828)
@@ -307,7 +307,7 @@ async def _get_data_from_port(
307307 dest_folder .prune (exclude = unarchived )
308308
309309 _logger .debug ("all unzipped in %s" , final_path )
310- except ArchiveError :
310+ except UnsupportedArchiveFormat :
311311 _logger .warning (
312312 "Could not extract archive '%s' to '%s' moving it to: '%s'" ,
313313 downloaded_file ,
You can’t perform that action at this time.
0 commit comments