Table of Contents

TryParse Method

Definition

Namespace
Cuemon.AspNetCore.Http
Assemblies
Cuemon.AspNetCore.dll
Source
src/Cuemon.AspNetCore/Http/HttpStatusCodeException.cs

TryParse(int, out HttpStatusCodeException)

Attempts to resolve a suitable httpStatusCodeException from the specified statusCode.

public static bool TryParse(int statusCode, out HttpStatusCodeException httpStatusCodeException)

Parameters

statusCode int

The HTTP status code to associate with this exception.

httpStatusCodeException HttpStatusCodeException

When this method returns, contains the by statusCode resolved HttpStatusCodeException, or null if no matches could be made.

Returns

bool

true if an instance of HttpStatusCodeException could be resolved, false otherwise.

TryParse(int, string, out HttpStatusCodeException)

Attempts to resolve a suitable httpStatusCodeException from the specified statusCode.

public static bool TryParse(int statusCode, string message, out HttpStatusCodeException httpStatusCodeException)

Parameters

statusCode int

The HTTP status code to associate with this exception.

message string

The message that describes the HTTP status code.

httpStatusCodeException HttpStatusCodeException

When this method returns, contains the by statusCode resolved HttpStatusCodeException, or null if no matches could be made.

Returns

bool

true if an instance of HttpStatusCodeException could be resolved, false otherwise.

TryParse(int, string, Exception, out HttpStatusCodeException)

Attempts to resolve a suitable httpStatusCodeException from the specified statusCode.

public static bool TryParse(int statusCode, string message, Exception innerException, out HttpStatusCodeException httpStatusCodeException)

Parameters

statusCode int

The HTTP status code to associate with this exception.

message string

The message that describes the HTTP status code.

innerException Exception

The exception that is the cause of the current exception.

httpStatusCodeException HttpStatusCodeException

When this method returns, contains the by statusCode resolved HttpStatusCodeException, or null if no matches could be made.

Returns

bool

true if an instance of HttpStatusCodeException could be resolved, false otherwise.