8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 22:43:03 +01:00

Print ON DISCONNECT trigger exceptions (including cancelling) to trace if log_errors = true

This commit is contained in:
Ilya Eremin 2022-03-16 11:02:25 +03:00 committed by Alexander Peshkov
parent 2f58d46285
commit 4031a937cb

View File

@ -8218,6 +8218,17 @@ static void purge_attachment(thread_db* tdbb, StableAttachmentPart* sAtt, unsign
attachment->att_flags = save_flags;
tdbb->tdbb_flags |= TDBB_detaching;
if (attachment->att_trace_manager->needs(ITraceFactory::TRACE_EVENT_ERROR))
{
FbLocalStatus status;
ex.stuffException(&status);
TraceConnectionImpl conn(attachment);
TraceStatusVectorImpl traceStatus(&status, TraceStatusVectorImpl::TS_ERRORS);
attachment->att_trace_manager->event_error(&conn, &traceStatus, FB_FUNCTION);
}
string s;
s.printf("Database: %s\n\tError at disconnect:", attachment->att_filename.c_str());
iscLogException(s.c_str(), ex);