OPC Studio User's Guide and Reference
UAStatusCodeException Constructor(String,UAStatusCode)



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace > UAStatusCodeException Class > UAStatusCodeException Constructor : UAStatusCodeException Constructor(String,UAStatusCode)
The error message that explains the reason for the exception.

The value of this parameter cannot be null (Nothing in Visual Basic).

A status code that describes the result of a service or operation.

Because the UAStatusCode has implicit conversions from System.Int64 and UASeverity, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a long integer (representing the internal status code value), or one of UASeverity enumeration members (representing the severity code) in place of this parameter, and the corresponding OPC UA status code will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the FromInt64 or FromUASeverity static method instead.

The value of this parameter cannot be null (Nothing in Visual Basic).

Initializes a new instance of the UAStatusCodeException class with a specified error message and a status code that is the cause of this exception.
Syntax
'Declaration
 
Public Function New( _
   ByVal message As String, _
   ByVal statusCode As UAStatusCode _
)
'Usage
 
Dim message As String
Dim statusCode As UAStatusCode
 
Dim instance As New UAStatusCodeException(message, statusCode)
public UAStatusCodeException( 
   string message,
   UAStatusCode statusCode
)
public:
UAStatusCodeException( 
   String^ message,
   UAStatusCode^ statusCode
)

Parameters

message
The error message that explains the reason for the exception.

The value of this parameter cannot be null (Nothing in Visual Basic).

statusCode
A status code that describes the result of a service or operation.

Because the UAStatusCode has implicit conversions from System.Int64 and UASeverity, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a long integer (representing the internal status code value), or one of UASeverity enumeration members (representing the severity code) in place of this parameter, and the corresponding OPC UA status code will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the FromInt64 or FromUASeverity static method instead.

The value of this parameter cannot be null (Nothing in Visual Basic).

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also