fix: improve misleading warning for progress callback exceptions (#775)

This commit is contained in:
Lorenzo 2025-09-30 10:39:52 -03:00 • committed by GitHub
commit d648a31359
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -392,11 +392,17 @@ class BaseSession(
# call it with the progress information
if progress_token in self._progress_callbacks:
callback = self._progress_callbacks[progress_token]
await callback(
notification.root.params.progress,
notification.root.params.total,
notification.root.params.message,
)
try:
await callback(
notification.root.params.progress,
notification.root.params.total,
notification.root.params.message,
)
except Exception as e:
logging.error(
"Progress callback raised an exception: %s",
e,
)
await self._received_notification(notification)
await self._handle_incoming(notification)
except Exception as e: