ExceptionRoutedEventArgs.ErrorException Property

Definition

Gets the exception that caused the error condition.

C#
public Exception ErrorException { get; }

Property Value

The exception that details the specific error condition.

Exceptions

The attempt to access the media file is denied.

The media file is not found.

The media file format is not supported by any installed codec.

-or-

The file format is not recognized.

Windows Media Player version 10 or later is not detected.

-or-

Video resources are insufficient for media playback.

A COM error code appears.

Examples

The following example creates a simple event handler for ExceptionRoutedEventArgs.

C#
private void Media_MediaFailed(object sender, ExceptionRoutedEventArgs args)
{
    MessageBox.Show(args.ErrorException.Message);
}

Applies to

Tuote Versiot
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10