Error Reporting - Send Error Report in Background Via Code
memeDeveloper
Posts: 21
Hi
I am using Smart Assembly 6 - Developer Edition. Mainly I am using the Error Reporting Feature and I have created a custom template for the error dialog box that gets shown to the user by modifying the "Custom UI" template in the SDK. Now, I need to show this dialog box to users for some exceptions while not show it for other exceptions.
I know that the OnReporException method in the "UnhandledExceptionHandlerWithAdvancedUI" class is what handles showing the dialog box.
I have checked the "UnhandledExceptionHandlerWithoutUI" class which is used to report errors without a dialog box (in the background) and the OnReportException code is different:
protected override void OnReportException(ReportExceptionEventArgs e)
{
for (int i=0; i<3; i++)
{
if (e.SendReport()) break;
}
e.TryToContinue = true;
}
If I use this code is my custom template instead of the one that shows the form, the reports gets sent in the background without a dialog box.
However, I need to have the option
to send the report in the background for some exceptions only and the rest by showing the custom dialog box.
Can that be achieved with Smart Assembly Error Reporting SDK? Is there a method that I can call to send that error report in the background ?
Thanks
I am using Smart Assembly 6 - Developer Edition. Mainly I am using the Error Reporting Feature and I have created a custom template for the error dialog box that gets shown to the user by modifying the "Custom UI" template in the SDK. Now, I need to show this dialog box to users for some exceptions while not show it for other exceptions.
I know that the OnReporException method in the "UnhandledExceptionHandlerWithAdvancedUI" class is what handles showing the dialog box.
I have checked the "UnhandledExceptionHandlerWithoutUI" class which is used to report errors without a dialog box (in the background) and the OnReportException code is different:
protected override void OnReportException(ReportExceptionEventArgs e)
{
for (int i=0; i<3; i++)
{
if (e.SendReport()) break;
}
e.TryToContinue = true;
}
If I use this code is my custom template instead of the one that shows the form, the reports gets sent in the background without a dialog box.
However, I need to have the option
to send the report in the background for some exceptions only and the rest by showing the custom dialog box.
Can that be achieved with Smart Assembly Error Reporting SDK? Is there a method that I can call to send that error report in the background ?
Thanks
Comments
//////////////////
protected override void OnReportException(ReportExceptionEventArgs e)
{
if (MyStaticBoolean)
{
e.SendReport();
e.TryToContinue = true;
}
else
{
ExceptionReportingForm form = new ExceptionReportingForm(this, e);
form.ShowDialog();
}
}
////
i.e. just put the conditional logic in the OnReportException Method. Bingo!