Skip to content

Commit bd992c6

Browse files
committed
chore: add batch details to breaking excs
1 parent 1f0e774 commit bd992c6

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

dank_mids/_batch.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,13 @@ async def _await(self) -> None:
8282
if isinstance(result, Exception):
8383
if not isinstance(result, DankMidsInternalError):
8484
logger.error(
85-
f"That's not good, there was an exception in a {batch.__class__.__name__}. These are supposed to be handled.\n{result}\n",
85+
"That's not good, there was an exception in a %s. These are supposed to be handled.\n"
86+
"Exc: %s\n"
87+
"%s contents: %s\n\n",
88+
batch.__class__.__name__,
89+
result,
90+
batch.__class__.__name__,
91+
list(batch),
8692
exc_info=True,
8793
)
8894
raise result

dank_mids/_requests.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -866,9 +866,13 @@ async def bisect_and_retry(self, e: Exception) -> List[RPCResponse]:
866866
if isinstance(result, Exception):
867867
if not isinstance(result, DankMidsInternalError):
868868
_log_error(
869-
"That's not good, there was an exception in a %s. These are supposed to be handled.\n%s\n",
869+
"That's not good, there was an exception in a %s. These are supposed to be handled.\n"
870+
"Exc: %s\n"
871+
"%s contents: %s\n\n",
870872
batch.__class__.__name__,
871873
result,
874+
batch.__class__.__name__,
875+
list(batch),
872876
exc_info=True,
873877
)
874878
raise result
@@ -1201,9 +1205,13 @@ async def bisect_and_retry(self, e: Exception) -> None:
12011205
if isinstance(result, Exception):
12021206
if not isinstance(result, DankMidsInternalError):
12031207
_log_error(
1204-
"That's not good, there was an exception in a %s. These are supposed to be handled.\n%s\n",
1208+
"That's not good, there was an exception in a %s. These are supposed to be handled.\n"
1209+
"Exc: %s\n"
1210+
"%s contents: %s\n\n",
12051211
batch.__class__.__name__,
12061212
result,
1213+
batch.__class__.__name__,
1214+
list(batch),
12071215
exc_info=True,
12081216
)
12091217
raise result

0 commit comments

Comments
 (0)