Skip to content

Commit

Permalink
Show plugin log more reliably
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Nov 3, 2023
1 parent 57af6c5 commit 624e423
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions MarkMpn.Sql4Cds.XTB/SqlQueryControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -829,19 +829,25 @@ private string GetErrorMessage(Exception error)
if (fault.Message != error.Message)
msg += "\r\n" + fault.Message;

if (fault.ErrorDetails.TryGetValue("Plugin.ExceptionFromPluginExecute", out var plugin))
msg += "\r\nError from plugin: " + plugin;

if (!String.IsNullOrEmpty(fault.TraceText))
msg += "\r\nTrace log: " + fault.TraceText;

while (fault.InnerFault != null)
{
if (fault.InnerFault.Message != fault.Message)
msg += "\r\n" + fault.InnerFault.Message;

fault = fault.InnerFault;
}

if (fault.ErrorDetails.TryGetValue("Plugin.ExceptionFromPluginExecute", out var plugin))
msg += "\r\nError from plugin: " + plugin;
if (fault.ErrorDetails.TryGetValue("Plugin.ExceptionFromPluginExecute", out plugin))
msg += "\r\nError from plugin: " + plugin;

if (!String.IsNullOrEmpty(fault.TraceText))
msg += "\r\nTrace log: " + fault.TraceText;
if (!String.IsNullOrEmpty(fault.TraceText))
msg += "\r\nTrace log: " + fault.TraceText;
}
}

return msg;
Expand Down

0 comments on commit 624e423

Please sign in to comment.