Outlook Error handling

Add-in Express™ Support Service
That's what is more important than anything else

Outlook Error handling
Byung Kun Kim

Posts: 48
Joined: 2011-12-15
In our company, we use external error reporting automation system.

I found ADX has below event in AddinModule, and works well when exception occurs within outlook AddinModule codes, and by "e.Handled = True" I can "not-showing-up" the ADX common error dialog window.

    Private Sub AddinModule_OnError(e As ADXErrorEventArgs) Handles Me.OnError
        ExceptionReporting.Report(e.ADXError) 'Report to our server
        e.Handled = True
    End Sub

But when exception occurred in ADXOlForm, it is not handled by this event procedure. and shows up the common ADX error dialog window.

1. Is there any equivalent way provided by ADX in ADXForms?
2. I wonder how exceptions in ItemEvents like? I didn't try throw exception in ItemEvents.
3. Is there any way to capture event like ADXBeforeErrorDialogShow?
Posted 21 Nov, 2016 02:29:01 Top
Andrei Smolin

Add-in Express team

Posts: 14294
Joined: 2006-05-11
Hello Byung,

1 and 3. Correct. There's the ADXError event on the ADXOlFormsManager component.
2. If you handle this event by intercepting the ItemSend event of the Outlook Events component (ADXOutlookAppEvents), then an exception in your event handler will be intercepted by AddinModule_OnError.

Consider these scenarios.
A. You intercept an Outlook event using the += notation in C# or the AddHandler statment in VB.NET.
B. You put a button onto an ADXOlForm and handle the Click event of the button

If an exception occurs in any of the event handlers above, you are responsible for handling the exception.

Also note that handling unhandled exceptions using the AppDomain.UnhandledException event won't intercept *all* the exceptions produced by your code. This is so because some errors occurs in the native code of the host application; in this case the native code knows nothing about the managed code, AppDomains and whatever. The only way out of this is to wrap every code fragment in a try/catch block.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 21 Nov, 2016 05:11:31 Top