Sdílet prostřednictvím


ErrorDetails Class

Definition

Additional details about an ErrorRecord

public ref class ErrorDetails : System::Runtime::Serialization::ISerializable
[System.Serializable]
public class ErrorDetails : System.Runtime.Serialization.ISerializable
public class ErrorDetails : System.Runtime.Serialization.ISerializable
[<System.Serializable>]
type ErrorDetails = class
    interface ISerializable
type ErrorDetails = class
    interface ISerializable
Public Class ErrorDetails
Implements ISerializable
Inheritance
ErrorDetails
Attributes
Implements

Remarks

ErrorDetails represents additional details about an ErrorRecord, starting with a replacement Message. Clients can use ErrorDetails when they want to display a more specific Message than the one contained in a particular Exception, without having to create a new Exception or define a new Exception class.

It is permitted to subclass ErrorDetails but there is no established scenario for doing this, nor has it been tested.

Constructors

ErrorDetails(Assembly, String, String, Object[])

Creates an instance of ErrorDetails specifying a Message. This variant is used by other code without a reference to a Cmdlet or CmdletProvider instance.

ErrorDetails(Cmdlet, String, String, Object[])

Creates an instance of ErrorDetails specifying a Message. This variant is used by cmdlets.

ErrorDetails(IResourceSupplier, String, String, Object[])

Creates an instance of ErrorDetails specifying a Message. This variant is used by CmdletProviders.

ErrorDetails(SerializationInfo, StreamingContext)

Initializes a new instance of the ErrorDetails class using data serialized via ISerializable

ErrorDetails(String)

Creates an instance of ErrorDetails specifying a Message.

Properties

Message

Message which replaces Message in Exception

RecommendedAction

Text describing the recommended action in the event that this error occurs. This is empty unless the code which generates the error specifies it explicitly.

Methods

GetObjectData(SerializationInfo, StreamingContext)

Serializer for ISerializable

ToString()

As ToString()

Applies to