Udostępnij za pośrednictwem


PromptingException Constructors

Definition

Overloads

PromptingException()

Initializes a new instance of the PromptingException class.

PromptingException(String)

Initializes a new instance of the PromptingException class and defines the error message.

PromptingException(SerializationInfo, StreamingContext)
Obsolete.

Initializes a new instance of the HostException class and defines the SerializationInfo and the StreamingContext.

PromptingException(String, Exception)

Initializes a new instance of the PromptingException class and defines the error message and inner exception.

PromptingException(String, Exception, String, ErrorCategory)

Initializes a new instance of the PromptingException class and defines the error message, inner exception, the error ID, and the error category.

PromptingException()

Initializes a new instance of the PromptingException class.

public:
 PromptingException();
public:
 PromptingException();
 PromptingException();
public PromptingException ();
Public Sub New ()

Applies to

PromptingException(String)

Initializes a new instance of the PromptingException class and defines the error message.

public:
 PromptingException(System::String ^ message);
public:
 PromptingException(Platform::String ^ message);
 PromptingException(std::wstring const & message);
public PromptingException (string message);
new System.Management.Automation.Host.PromptingException : string -> System.Management.Automation.Host.PromptingException
Public Sub New (message As String)

Parameters

message
String

The error message that explains the reason for the exception.

Applies to

PromptingException(SerializationInfo, StreamingContext)

Caution

Legacy serialization support is deprecated since .NET 8

Initializes a new instance of the HostException class and defines the SerializationInfo and the StreamingContext.

protected:
 PromptingException(System::Runtime::Serialization::SerializationInfo ^ info, System::Runtime::Serialization::StreamingContext context);
protected PromptingException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
[System.Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId="SYSLIB0051")]
protected PromptingException (System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context);
new System.Management.Automation.Host.PromptingException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.Automation.Host.PromptingException
[<System.Obsolete("Legacy serialization support is deprecated since .NET 8", DiagnosticId="SYSLIB0051")>]
new System.Management.Automation.Host.PromptingException : System.Runtime.Serialization.SerializationInfo * System.Runtime.Serialization.StreamingContext -> System.Management.Automation.Host.PromptingException
Protected Sub New (info As SerializationInfo, context As StreamingContext)

Parameters

info
SerializationInfo

The object that holds the serialized object data.

context
StreamingContext

The contextual information about the source or destination.

Attributes

Applies to

PromptingException(String, Exception)

Initializes a new instance of the PromptingException class and defines the error message and inner exception.

public:
 PromptingException(System::String ^ message, Exception ^ innerException);
public PromptingException (string message, Exception innerException);
new System.Management.Automation.Host.PromptingException : string * Exception -> System.Management.Automation.Host.PromptingException
Public Sub New (message As String, innerException As Exception)

Parameters

message
String

The error message that explains the reason for the exception.

innerException
Exception

The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

Applies to

PromptingException(String, Exception, String, ErrorCategory)

Initializes a new instance of the PromptingException class and defines the error message, inner exception, the error ID, and the error category.

public:
 PromptingException(System::String ^ message, Exception ^ innerException, System::String ^ errorId, System::Management::Automation::ErrorCategory errorCategory);
public PromptingException (string message, Exception innerException, string errorId, System.Management.Automation.ErrorCategory errorCategory);
new System.Management.Automation.Host.PromptingException : string * Exception * string * System.Management.Automation.ErrorCategory -> System.Management.Automation.Host.PromptingException
Public Sub New (message As String, innerException As Exception, errorId As String, errorCategory As ErrorCategory)

Parameters

message
String

The error message that explains the reason for the exception.

innerException
Exception

The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception.

errorId
String

The string that should uniquely identifies the situation where the exception is thrown. The string should not contain white space.

errorCategory
ErrorCategory

The ErrorCategory into which this exception situation falls

Remarks

Intentionally public, third-party hosts can call this

Applies to