CommandResults.Failure Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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.