Created
September 27, 2014 17:57
-
-
Save jayd3e/4e12a3cb595ab2439011 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@event.listens_for(Engine, "handle_error") | |
def handle_exception(context): | |
if isinstance(context.original_exception, | |
psycopg2.OperationalError) and \ | |
"SSL disconnect" in str(context.original_exception): | |
context.is_disconnect=True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment