A Sandcastle Documented Class Library

# ExceptionExtensions SetErrorCode Method

Sets the error code on an exception object.

Namespace: Dundas.BI
Assembly: Dundas.BI.Core (in Dundas.BI.Core.dll) Version: 2.0.0.0 (10.0.0.1002)
Syntax
C#
VB
C++
F#
Copy

    public static Exception SetErrorCode(
    	this Exception exception,
    	int errorCode
    )

    <ExtensionAttribute>
    Public Shared Function SetErrorCode (
    	exception As Exception,
    	errorCode As Integer
    ) As Exception

    public:
    [ExtensionAttribute]
    static Exception^ SetErrorCode(
    	Exception^ exception,
    	int errorCode
    )

    [<ExtensionAttribute>]
    static member SetErrorCode :
            exception : Exception *
            errorCode : int -> Exception

#### Parameters

exception
  Type: System
  Exception
  The exception.
errorCode
  Type: System
  Int32
  The error code to assign to exception.

#### Return Value

Type: Exception
The provided exception.

#### Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Exception. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Exceptions

Exception | Condition
--- | ---
ArgumentNullException | exception is .

See Also

#### Reference

ExceptionExtensions Class
Dundas.BI Namespace