Skip to content

Commit

Permalink
raise as more generic ConnectionError, because ClientResponseError ca…
Browse files Browse the repository at this point in the history
…nnot be created easily
  • Loading branch information
ungarj committed Dec 3, 2024
1 parent 054ca7e commit 260fc33
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions mapchete/executor/future.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def skip(skip_info: Optional[Any] = None, result: Optional[Any] = None) -> MFutu
def from_func(
func: Callable, fargs: Optional[Tuple] = None, fkwargs: Optional[Dict] = None
) -> MFuture:
fkwargs = fkwargs or {}
try:
return MFuture(result=func(*fargs, **fkwargs))
except Exception as exc: # pragma: no cover
Expand Down
5 changes: 3 additions & 2 deletions mapchete/io/_misc.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import logging
from enum import Enum

from aiohttp import ClientResponseError
import rasterio
from rasterio.warp import calculate_default_transform
from shapely.errors import TopologicalError
Expand Down Expand Up @@ -216,5 +215,7 @@ def copy(src_path, dst_path, src_fs=None, dst_fs=None, overwrite=False):
if repr(exception).startswith(
'Exception("ClientResponseError'
): # pragma: no cover
raise ClientResponseError(exception) from exception
raise ConnectionError(repr(exception)).with_traceback(
exception.__traceback__
) from exception
raise

0 comments on commit 260fc33

Please sign in to comment.