C# Class Microsoft.HockeyApp.Extensibility.Windows.UnhandledExceptionTelemetryModule

A module that deals in Exception events and will create ExceptionTelemetry objects when triggered.
Inheritance: IUnhandledExceptionTelemetryModule
Exibir arquivo Open project: bitstadium/HockeySDK-Windows

Private Properties

Property Type Description
CoreApplication_UnhandledErrorDetected void
GetProcessorArchitecture ushort
GetStrackTrace string
TaskScheduler_UnobservedTaskException void
UnhandledExceptionTelemetryModule System

Public Methods

Method Description
CreateCrashTelemetry ( Exception exception, ExceptionHandledAt handledAt ) : ITelemetry

Creates CrashTelemetry instance.

Dispose ( ) : void

Unsubscribe from the Application.UnhandledException event.

Initialize ( ) : void

Subscribes to unhandled event notifications. We are using CoreApplication.UnhandledErrorDetected instead of Application.UnhandledException because Application.UnhandledException is not idempotent and the exception object may be read only once. The second time it is read, it will return empty System.Exception without call stack. It is OS Bug 560663, 7133918 that must be fixed in Windows Redstone 2 (~2017).

Private Methods

Method Description
CoreApplication_UnhandledErrorDetected ( object sender, UnhandledErrorDetectedEventArgs e ) : void
GetProcessorArchitecture ( ) : ushort

Get the processor architecture of this computer.

This method cannot be used in SDK other than UWP, because it is using NativeMethods.GetNativeSystemInfo(ref NativeMethods._SYSTEM_INFO) API, which violates Windows Phone certification requirements for WinRT platform, see https://www.yammer.com/microsoft.com/#/uploaded_files/59829318?threadId=718448267

GetStrackTrace ( Exception e ) : string
TaskScheduler_UnobservedTaskException ( object sender, System.Threading.Tasks.UnobservedTaskExceptionEventArgs e ) : void
UnhandledExceptionTelemetryModule ( ) : System

Initializes a new instance of the UnhandledExceptionTelemetryModule class.

Method Details

CreateCrashTelemetry() public method

Creates CrashTelemetry instance.
public CreateCrashTelemetry ( Exception exception, ExceptionHandledAt handledAt ) : ITelemetry
exception System.Exception The exception to initialize the class with.
handledAt ExceptionHandledAt Determines whether exception is handled or unhandled.
return ITelemetry

Dispose() public method

Unsubscribe from the Application.UnhandledException event.
public Dispose ( ) : void
return void

Initialize() public method

Subscribes to unhandled event notifications. We are using CoreApplication.UnhandledErrorDetected instead of Application.UnhandledException because Application.UnhandledException is not idempotent and the exception object may be read only once. The second time it is read, it will return empty System.Exception without call stack. It is OS Bug 560663, 7133918 that must be fixed in Windows Redstone 2 (~2017).
public Initialize ( ) : void
return void