SIGN IN SIGN UP

fix(db): log the exception class when a DB error has no message (#3762)

asyncpg raises several of its connection and pool errors with no args, so
str(e) is the empty string for them. The acquire and retry paths interpolated
str(e), which rendered a failure as:

    Database acquire failed after 4 attempts:

dropping the one field that says what actually happened. InterfaceError alone
covers a dropped connection, a closed pool and an uninitialised pool -- three
conditions with completely different responses, two of which no amount of
retrying or database recovery can fix -- and the log could not tell them apart.
The readiness payload had the same hole: health_check returned str(e) in its
"error" field, which is the first thing an operator reads when the database
looks down.

Switch both to repr(), which always carries the class name. Same fix and same
reasoning as recall_async's wrapper message (#1384).

Claude-Session: https://claude.ai/code/session_01TbssiuHs32rLNMPYutRwub
N
Nicolò Boschi committed
2139d045ebb1a4ef7c789ca3114e4b3cae58ce15
Parent: ea9b2fe
Committed by GitHub <noreply@github.com> on 8/24/2026, 12:35:10 PM