8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-23 00:03:02 +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 fc85f89be4
commit ddec610a08

View File

@ -8216,6 +8216,17 @@ static void purge_attachment(thread_db* tdbb, StableAttachmentPart* sAtt, unsign
attachment->att_flags = save_flags; attachment->att_flags = save_flags;
tdbb->tdbb_flags |= TDBB_detaching; 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; string s;
s.printf("Database: %s\n\tError at disconnect:", attachment->att_filename.c_str()); s.printf("Database: %s\n\tError at disconnect:", attachment->att_filename.c_str());
iscLogException(s.c_str(), ex); iscLogException(s.c_str(), ex);