Fix redundant except clause: ValueError is subclass of Exception
except (ValueError, Exception) was redundant since ValueError already inherits from Exception. Simplified all 3 occurrences in the bbox resolution error handlers.
This commit is contained in:
parent
31dff49351
commit
c2d54e7d59
@ -307,7 +307,7 @@ async def get_imagery(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
resolved_bbox = await _resolve_bbox(client, bbox, place)
|
resolved_bbox = await _resolve_bbox(client, bbox, place)
|
||||||
except (ValueError, Exception) as exc:
|
except Exception as exc:
|
||||||
return [{"type": "text", "text": str(exc)}]
|
return [{"type": "text", "text": str(exc)}]
|
||||||
|
|
||||||
image_format = f"image/{format}"
|
image_format = f"image/{format}"
|
||||||
@ -368,7 +368,7 @@ async def compare_dates(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
resolved_bbox = await _resolve_bbox(client, bbox, place)
|
resolved_bbox = await _resolve_bbox(client, bbox, place)
|
||||||
except (ValueError, Exception) as exc:
|
except Exception as exc:
|
||||||
return [{"type": "text", "text": str(exc)}]
|
return [{"type": "text", "text": str(exc)}]
|
||||||
|
|
||||||
composite_bytes = await client.compare_dates(
|
composite_bytes = await client.compare_dates(
|
||||||
@ -420,7 +420,7 @@ async def get_imagery_composite(
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
resolved_bbox = await _resolve_bbox(client, bbox, place)
|
resolved_bbox = await _resolve_bbox(client, bbox, place)
|
||||||
except (ValueError, Exception) as exc:
|
except Exception as exc:
|
||||||
return [{"type": "text", "text": str(exc)}]
|
return [{"type": "text", "text": str(exc)}]
|
||||||
|
|
||||||
image_bytes = await client.get_wms_composite(
|
image_bytes = await client.get_wms_composite(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user