Share via


CommandResults.Failure Method

Definition

Overloads

Failure(Exception)

Produces an unsuccessful result from an Exception. Message is used as the error message.

Failure(String)

Produces an unsuccessful result with an error message.

Failure(Exception)

Source:
ResourceCommandAnnotation.cs
Source:
ResourceCommandAnnotation.cs

Produces an unsuccessful result from an Exception. Message is used as the error message.

public static Aspire.Hosting.ApplicationModel.ExecuteCommandResult Failure(Exception exception);
static member Failure : Exception -> Aspire.Hosting.ApplicationModel.ExecuteCommandResult
Public Shared Function Failure (exception As Exception) As ExecuteCommandResult

Parameters

exception
Exception

The exception to get the error message from.

Returns

Applies to

Failure(String)

Source:
ResourceCommandAnnotation.cs
Source:
ResourceCommandAnnotation.cs

Produces an unsuccessful result with an error message.

public static Aspire.Hosting.ApplicationModel.ExecuteCommandResult Failure(string? errorMessage = default);
static member Failure : string -> Aspire.Hosting.ApplicationModel.ExecuteCommandResult
Public Shared Function Failure (Optional errorMessage As String = Nothing) As ExecuteCommandResult

Parameters

errorMessage
String

An optional error message.

Returns

Applies to