共用方式為


SPCmdlet.ThrowTerminatingError Method (Exception, , Object, String)

Writes the details of a terminating error to the screen as an error message and logs the details in a log file.

Namespace:  Microsoft.SharePoint.PowerShell
Assembly:  Microsoft.SharePoint.PowerShell (in Microsoft.SharePoint.PowerShell.dll)

Syntax

'Declaration
Protected Sub ThrowTerminatingError ( _
    exception As Exception, _
    category As ErrorCategory, _
    target As Object, _
    helpUrl As String _
)
'Usage
Dim exception As Exception
Dim category As ErrorCategory
Dim target As Object
Dim helpUrl As String

Me.ThrowTerminatingError(exception, _
    category, target, helpUrl)
protected void ThrowTerminatingError(
    Exception exception,
    ErrorCategory category,
    Object target,
    string helpUrl
)

Parameters

  • exception
    Type: System.Exception

    The exception that was thrown that indicates the terminating error.

  • category
    Type: ErrorCategory

    Literal description of the error.

  • target
    Type: System.Object

    The instance or its identity that is the source of the error.

  • helpUrl
    Type: System.String

    A URL to an optional page that provides additional information about the error.

Remarks

When this method is called, an error record is sent to the error pipeline and the cmdlet stops executing.

See Also

Reference

SPCmdlet Class

SPCmdlet Members

ThrowTerminatingError Overload

Microsoft.SharePoint.PowerShell Namespace

ThrowTerminatingError(Exception, ErrorCategory, Object)

Cmdlet.ThrowTerminatingError