Exceptions

The C# clients detects a number of errors. This is especially important when the framework is used for untyped applications as there are more possibilities for runtime errors. The framework has three exception classes.

WSManException

For C# implementations, this class inherits from WebException. This exception represents a WS-Management error, and contains the WS-Management fault information.

These exceptions, along with others that are defined in the C# standard library, are thrown whenever an error occurs.

Representative Exceptions

The following table describes the exceptions that can occur.

Exception Thrown

Description

Details

ArgumentNullException

Attempting to add a NULL value field to a CIM object

When attempting to add a field to a CIM object, either when using the untyped interface, or when adding an optional field to a strongly typed object, the framework throws an exception if the value of the field is NULL.

Attempting to set the value of a field in a CIM object to NULL

When attempting to set the value of a field in a CIM object the framework throws an exception if the value is NULL.

ArgumentException

Attempting to set invalid value of a field in a CIM object to NULL

When attempting to get a selector from a selectors class, the framework throws an exception if that selector does not exist in the selectors collection.

InvalidDataException

Attempting to set proxy parameters

Throw only by WinRM client when trying to initialize the client with proxy parameters that does not supported by the client.

NotImplementedException

Attempting to execute methods that does not supported.

Throw only by WinRM client when trying to call subscribe or unsubscribe methods.

Copyright © 2006-2022, Intel Corporation. All rights reserved.