fix(gateway): log error-notification failures instead of silently swallowing (#54472)

* fix(gateway): log error-notification failures instead of silently swallowing

The last-resort exception handler in _process_message_background() that
sends an error notice to the user caught all exceptions with a bare pass,
leaving zero trace when the notification itself failed. Upgrade to
logger.error(..., exc_info=True) so a failed error-notification send is
debuggable post-mortem.

Salvaged from #6499 by @BongSuCHOI (the logging-upgrade portion only).

* docs: add PR infographic for gateway error-notify logging
This commit is contained in:
Teknium 2026-06-28 18:52:51 -07:00 committed by GitHub
parent 3483424aaa
commit f1cbe4308f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -4955,8 +4955,11 @@ class BasePlatformAdapter(ABC):
),
metadata=_thread_metadata,
)
except Exception:
pass # Last resort — don't let error reporting crash the handler
except Exception as notify_err:
logger.error(
"[%s] Failed to send error notification to user: %s",
self.name, notify_err, exc_info=True,
) # Last resort — don't let error reporting crash the handler
finally:
# Stop typing before any deferred callback work. Post-delivery
# callbacks may perform platform I/O; a stuck callback must not

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 MiB