You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found this within a large Flask application but I managed to reproduce it.
SQLAlchemy's exceptions contain an .orig attribute with the original DBAPI exception. I only raised it to see it in the werkzeug debugger, and found that the debugger page never loads.
fromwerkzeug.wrappersimportRequest, Responsefromsqlalchemyimportcreate_engine, textfromsqlalchemy.excimportDatabaseErrorengine=create_engine('sqlite://')
@Request.applicationdefapplication(request):
try:
engine.execute(text('SELECT undefined_function()'))
exceptDatabaseErrorasexc:
# if we just re-raise, it works fine# raise# exc.orig is definitely an exceptionassertisinstance(exc.orig, Exception)
# werkzeug doesn't return a response when this is raisedraiseexc.origreturnResponse('This is unreachable')
if__name__=='__main__':
fromwerkzeug.servingimportrun_simplerun_simple('localhost', 4000, application, use_debugger=True)
The same happens for a PostgreSQL (psycopg2) connection.
The text was updated successfully, but these errors were encountered:
I found this within a large Flask application but I managed to reproduce it.
SQLAlchemy's exceptions contain an
.orig
attribute with the original DBAPI exception. I only raised it to see it in the werkzeug debugger, and found that the debugger page never loads.The same happens for a PostgreSQL (psycopg2) connection.
The text was updated successfully, but these errors were encountered: