How to properly catch overloaded pool errors?
deadtrickster opened this issue · comments
Iliia Khaprov commented
Hi,
When checkout timeout happens DBConnection.ConnectionError raised. However it also raised in several other places and even in tests assertion uses regex for the message: ~r"connection not available and request was dropped from queue after \d+ms".
Should I use same regex matching?
José Valim commented
Yes. I think introducing another exception for this at this point would unfortunately be a breaking change. :/
Cẩm Huỳnh commented
Could we maybe introduce metadata to the existing exception? Something like [reason: :checkout_timeout]
?
José Valim commented
That could be handy, yes!
Cẩm Huỳnh commented
👍 Awesome, I can prepare a PR.
Iliia Khaprov commented
@qcam ping