1 out of 2 rated this helpful - Rate this topic

ErrorCategory Enumeration

[This topic is pre-release documentation and is subject to change in future releases. Blank topics are included as placeholders.]

Defines the error categories used to group errors for display purposes.


Namespace: System.Management.Automation
Assembly: System.Management.Automation (in System.Management.Automation)
'Usage
Dim instance As ErrorCategory

public enum ErrorCategory
public enum ErrorCategory
public enum ErrorCategory
Member name Description
CloseError An error that occurs when closing.
DeadlockDetected An error that occurs when a deadlock is detected.
DeviceError An error that occurs when a device reports an error.
FromStdErr An error that occurs when a non-Windows PowerShell command reports an error to its STDERR pipe.
InvalidArgument An error that occurs when an argument that is not valid is specified.
InvalidData An error that occurs when data that is not valid is specified.
InvalidOperation An error that occurs when an operation that is not valid is requested.
InvalidResult An error that occurs when a result that is not valid is returned.
InvalidType An error that occurs when a .NET Framework type that is not valid is specified.
MetadataError An error that occurs when metadata contains an error.
NotImplemented An error that occurs when a referenced application programming interface (API) is not implemented.
NotInstalled An error that occurs when an item is not installed.
NotSpecified Use only when not enough is known about the error to assign it to another error category. Avoid using this category if you have any information about the error, even if that information is incomplete.
ObjectNotFound An error that occurs when an object cannot be found.
OpenError An error that occurs when opening.
OperationStopped An error that occurs when an operation has stopped. For example, the user interrupts the operation.
OperationTimeout An error that occurs when an operation has exceeded its timeout limit.
ParserError An error that occurs when a parser encounters an error.
PermissionDenied An error that occurs when an operation is not permitted.
ReadError An error that occurs when reading.
ResourceBusy An error that occurs when a resource is busy.
ResourceExists An error that occurs when a resource already exists.
ResourceUnavailable An error that occurs when a resource is unavailable.
SecurityError An error that occurs when a security violation occurs. This field is introduced in Windows PowerShell 2.0.
SyntaxError An error that occurs when a command is syntactically incorrect.
WriteError An error that occurs when writing.

Windows PowerShell displays errors based on these categories when the $ErrorView shell variable is set to CategoryView. Cmdlet developers should choose between these categories whenever possible to ensure consistency when reporting errors. For more information, see Windows PowerShell Error Reporting.

Avoid specifying the NotSpecified constant when creating an ErrorRecord object, even if none of the constants defined by this enumeration matches perfectly the error you are reporting. Instead, choose the best match.


 

Target Platforms

Windows Developer Preview, Windows Server Developer Preview

Send comments about this topic to Microsoft.
Did you find this helpful?
(1500 characters remaining)