PIException Constructor
- Last UpdatedNov 18, 2025
- 2 minute read
- PI System
- AF SDK 2024 R2
- Developer
Initializes a new instance of the PIException class with a
specified error message, status code, and a reference to the inner exception
that is the cause of this exception.
Namespace: OSIsoft.AF.PI
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public PIException( PIServer piServer, string message, int statusCode, Exception innerException = null )
Public Sub New ( piServer As PIServer, message As String, statusCode As Integer, Optional innerException As Exception = Nothing ) Dim piServer As PIServer Dim message As String Dim statusCode As Integer Dim innerException As Exception Dim instance As New PIException(piServer, message, statusCode, innerException)
public: PIException( PIServer^ piServer, String^ message, int statusCode, Exception^ innerException = nullptr )
new : piServer : PIServer * message : string * statusCode : int * ?innerException : Exception (* Defaults: let _innerException = defaultArg innerException null *) -> PIException
Parameters
- piServer
- Type: OSIsoft.AF.PIPIServer
The PIServer associated with the exception. - message
- Type: SystemString
The error message that explains the reason for the exception. - statusCode
- Type: SystemInt32
The status code indicating the cause of the current exception that was returned from the PIServer. - innerException (Optional)
- Type: SystemException
The exception that is the cause of the current exception, or if no inner exception is specified.
Remarks
This constructor initializes the Message, StatusCode,
and InnerException properties of the new instance with the
specified parameters.
An exception that is thrown as a direct result of a previous exception should
include a reference to the previous exception in the InnerException
property.