Skip to content

Reference

OpcException Members

The exception that is thrown when an OPC operation has failed.

Reference

OpcException Members ​

Type
OpcException
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0
Also in
Opc.UaFx.Client

Inherits members from Exception.

Constructors ​

OpcException ​

15 overloads

OverloadDescription
OpcException()Initializes a new instance of the OpcException class with default properties.
OpcException(OpcContext)since v2.11Initializes a new instance of the OpcException class with default properties and the context specified.
OpcException(string)Initializes a new instance of the OpcException class with the message specified.
OpcException(OpcContext, string)since v2.11Initializes a new instance of the OpcException class with the context and message specified.
OpcException(OpcStatusCode)Initializes a new instance of the OpcException class with the specified code.
OpcException(OpcContext, OpcStatusCode)since v2.11Initializes a new instance of the OpcException class with the specified context and code.
OpcException(OpcStatusCode, string)Initializes a new instance of the OpcException class with the code and message specified.
OpcException(OpcContext, OpcStatusCode, string)since v2.11Initializes a new instance of the OpcException class with the context, code and message specified.
OpcException(OpcStatusCode, string, Exception)Initializes a new instance of the OpcException class with the code, message and inner exception specified.
OpcException(OpcContext, OpcStatusCode, string, Exception)since v2.11Initializes a new instance of the OpcException class with the context, code, message and inner specified.
OpcException(OpcStatusCode, Exception)Initializes a new instance of the OpcException class with the specified code and inner exception.
OpcException(OpcContext, OpcStatusCode, Exception)since v2.11Initializes a new instance of the OpcException class with the specified context, code and inner exception.
OpcException(OpcResult)Initializes a new instance of the OpcException class using the result information specified.
OpcException(OpcContext, OpcResult)since v2.11Initializes a new instance of the OpcException class using the context and result information specified.
OpcException(SerializationInfo, StreamingContext)protectedInitializes a new instance of the OpcException class with serialized data.

OpcException() ​

Initializes a new instance of the OpcException class with default properties.

csharp
public OpcException()
vbnet
Public Sub New()

OpcException(OpcContext) ​

since v2.11

Initializes a new instance of the OpcException class with default properties and the context specified.

csharp
public OpcException(OpcContext context)
vbnet
Public Sub New(context As OpcContext)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.

OpcException(string) ​

Initializes a new instance of the OpcException class with the message specified.

csharp
public OpcException(string message)
vbnet
Public Sub New(message As String)

Parameters

NameTypeDescription
messageStringThe Message.

OpcException(OpcContext, string) ​

since v2.11

Initializes a new instance of the OpcException class with the context and message specified.

csharp
public OpcException(OpcContext context, string message)
vbnet
Public Sub New(context As OpcContext, message As String)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.
messageStringThe Message.

OpcException(OpcStatusCode) ​

Initializes a new instance of the OpcException class with the specified code.

csharp
[CLSCompliant(false)]
public OpcException(OpcStatusCode code)
vbnet
<CLSCompliant(False)>
Public Sub New(code As OpcStatusCode)

Parameters

NameTypeDescription
codeOpcStatusCodeThe OpcStatusCode upon its value the according Message is used for the new instance of the OpcException class.

OpcException(OpcContext, OpcStatusCode) ​

since v2.11

Initializes a new instance of the OpcException class with the specified context and code.

csharp
[CLSCompliant(false)]
public OpcException(OpcContext context, OpcStatusCode code)
vbnet
<CLSCompliant(False)>
Public Sub New(context As OpcContext, code As OpcStatusCode)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.
codeOpcStatusCodeThe OpcStatusCode upon its value the according Message is used for the new instance of the OpcException class.

OpcException(OpcStatusCode, string) ​

Initializes a new instance of the OpcException class with the code and message specified.

csharp
[CLSCompliant(false)]
public OpcException(OpcStatusCode code, string message)
vbnet
<CLSCompliant(False)>
Public Sub New(code As OpcStatusCode, message As String)

Parameters

NameTypeDescription
codeOpcStatusCodeThe OpcStatusCode which is described by the message.
messageStringThe Message.

OpcException(OpcContext, OpcStatusCode, string) ​

since v2.11

Initializes a new instance of the OpcException class with the context, code and message specified.

csharp
[CLSCompliant(false)]
public OpcException(OpcContext context, OpcStatusCode code, string message)
vbnet
<CLSCompliant(False)>
Public Sub New(context As OpcContext, code As OpcStatusCode, message As String)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.
codeOpcStatusCodeThe OpcStatusCode which is described by the message.
messageStringThe Message.

OpcException(OpcStatusCode, string, Exception) ​

Initializes a new instance of the OpcException class with the code, message and inner exception specified.

csharp
[CLSCompliant(false)]
public OpcException(OpcStatusCode code, string message, Exception inner)
vbnet
<CLSCompliant(False)>
Public Sub New(code As OpcStatusCode, message As String, inner As Exception)

Parameters

NameTypeDescription
codeOpcStatusCodeThe OpcStatusCode which is described by the message.
messageStringThe Message.
innerExceptionThe exception that is the cause of the current exception. If the inner parameter is not null (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

OpcException(OpcContext, OpcStatusCode, string, Exception) ​

since v2.11

Initializes a new instance of the OpcException class with the context, code, message and inner specified.

csharp
[CLSCompliant(false)]
public OpcException(
    OpcContext context,
    OpcStatusCode code,
    string message,
    Exception inner)
vbnet
<CLSCompliant(False)>
Public Sub New(
    context As OpcContext,
    code As OpcStatusCode,
    message As String,
    inner As Exception)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.
codeOpcStatusCodeThe OpcStatusCode which is described by the message.
messageStringThe Message.
innerExceptionThe exception that is the cause of the current exception. If the inner parameter is not null (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

OpcException(OpcStatusCode, Exception) ​

Initializes a new instance of the OpcException class with the specified code and inner exception.

csharp
[CLSCompliant(false)]
public OpcException(OpcStatusCode code, Exception inner)
vbnet
<CLSCompliant(False)>
Public Sub New(code As OpcStatusCode, inner As Exception)

Parameters

NameTypeDescription
codeOpcStatusCodeThe OpcStatusCode upon its value the according Message is used for the new instance of the OpcException class.
innerExceptionThe exception that is the cause of the current exception. If the inner parameter is not null (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

OpcException(OpcContext, OpcStatusCode, Exception) ​

since v2.11

Initializes a new instance of the OpcException class with the specified context, code and inner exception.

csharp
[CLSCompliant(false)]
public OpcException(OpcContext context, OpcStatusCode code, Exception inner)
vbnet
<CLSCompliant(False)>
Public Sub New(context As OpcContext, code As OpcStatusCode, inner As Exception)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.
codeOpcStatusCodeThe OpcStatusCode upon its value the according Message is used for the new instance of the OpcException class.
innerExceptionThe exception that is the cause of the current exception. If the inner parameter is not null (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception.

OpcException(OpcResult) ​

Initializes a new instance of the OpcException class using the result information specified.

csharp
public OpcException(OpcResult result)
vbnet
Public Sub New(result As OpcResult)

Parameters

NameTypeDescription
resultOpcResultThe OpcResult from that the exception information is to be retrieved.

OpcException(OpcContext, OpcResult) ​

since v2.11

Initializes a new instance of the OpcException class using the context and result information specified.

csharp
public OpcException(OpcContext context, OpcResult result)
vbnet
Public Sub New(context As OpcContext, result As OpcResult)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext which was in use while the new OpcException was generated.
resultOpcResultThe OpcResult from that the exception information is to be retrieved.

OpcException(SerializationInfo, StreamingContext) ​

protected

Initializes a new instance of the OpcException class with serialized data.

csharp
protected OpcException(SerializationInfo info, StreamingContext context)
vbnet
Protected Sub New(info As SerializationInfo, context As StreamingContext)

Parameters

NameTypeDescription
infoSerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
contextStreamingContextThe StreamingContext that contains contextual information about the source or destination.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe info parameter is a null reference (Nothing in Visual Basic).
SerializationExceptionThe class name is a null reference (Nothing in Visual Basic) or HResult is zero (0).

Properties ​

Code ​

Gets the according OpcStatusCode for the ErrorCode.

csharp
[CLSCompliant(false)]
public OpcStatusCode Code { get; }
vbnet
<CLSCompliant(False)>
Public ReadOnly Property Code As OpcStatusCode

Property value

OpcStatusCode

One of the members defined by the OpcStatusCode enumeration.

Context ​

since v2.11

Gets the OpcContext which was in use while the current OpcException was generated.

csharp
public OpcContext Context { get; }
vbnet
Public ReadOnly Property Context As OpcContext

Property value

OpcContext

An instance of the OpcContext which was used to store context sensitive data and configuration while the current OpcException was generated.

Remarks

The OpcContext instance is at least Empty.

Data ​

override · since v2.7

Gets a collection of key/value pairs that provide additional user-defined information about the exception.

csharp
public override IDictionary Data { get; }
vbnet
Public Overrides ReadOnly Property Data As IDictionary

Property value

IDictionary

An object that implements the IDictionary interface and contains a collection of user-defined key/value pairs. The default is an empty collection.

Overrides

Data

ErrorCode ​

Gets the error code of the OpcException.

csharp
[CLSCompliant(false)]
public uint ErrorCode { get; }
vbnet
<CLSCompliant(False)>
Public ReadOnly Property ErrorCode As UInteger

Property value

UInt32

The error code of the OpcException.

override · since v2.7

Gets or sets a link to the help file associated with this exception.

csharp
public override string HelpLink { get; set; }
vbnet
Public Overrides Property HelpLink As String

Property value

String

The Uniform Resource Name (URN) or Uniform Resource Locator (URL).

Overrides

HelpLink

Message ​

override

Gets a message that describes the current exception.

csharp
public override string Message { get; }
vbnet
Public Overrides ReadOnly Property Message As String

Property value

String

The error message that explains the reason for the exception.

Overrides

Message

Result ​

Gets the result information associated with the exception.

csharp
public OpcResult Result { get; }
vbnet
Public ReadOnly Property Result As OpcResult

Property value

OpcResult

An instance of the OpcResult class from that the exception has been initialized.

Source ​

override · since v2.7

Gets or sets the name of the application or the object that causes the error.

csharp
public override string Source { get; set; }
vbnet
Public Overrides Property Source As String

Property value

String

The name of the application or the object that causes the error.

Overrides

Source

StackTrace ​

override · since v2.7

Gets a string representation of the immediate frames on the call stack.

csharp
public override string StackTrace { get; }
vbnet
Public Overrides ReadOnly Property StackTrace As String

Property value

String

A string that describes the immediate frames of the call stack.

Overrides

StackTrace

Methods ​

GetBaseException ​

override · since v2.8

Returns the System.Exception that is the root cause of one or more subsequent exceptions.

csharp
public override Exception GetBaseException()
vbnet
Public Overrides Function GetBaseException() As Exception

Returns

Exception

The first exception thrown in a chain of exceptions.

Overrides

GetBaseException()

GetObjectData ​

override

Sets the SerializationInfo with information about the exception.

csharp
public override void GetObjectData(
    SerializationInfo info,
    StreamingContext context)
vbnet
Public Overrides Sub GetObjectData(
    info As SerializationInfo,
    context As StreamingContext)

Parameters

NameTypeDescription
infoSerializationInfoThe SerializationInfo that holds the serialized object data about the exception being thrown.
contextStreamingContextThe StreamingContext that contains contextual information about the source or destination.

Exceptions

ExceptionCondition
ArgumentNullExceptionThe info parameter is a null reference (Nothing in Visual Basic).

Overrides

GetObjectData(SerializationInfo, StreamingContext)

ToString ​

override · since v2.8

Creates and returns a string representation of the exception.

csharp
public override string ToString()
vbnet
Public Overrides Function ToString() As String

Returns

String

The full name of the type of the exception and its Message, followed by its StackTrace on a new line if there is one.

Overrides

ToString()

Remarks

Unlike ToString(), the string does not contain the inner exceptions.