TryParse Method
Definition
- Namespace
- Cuemon.AspNetCore.Http
- Assemblies
- Cuemon.AspNetCore.dll
TryParse(int, out HttpStatusCodeException)
Attempts to resolve a suitable httpStatusCodeException from the specified statusCode.
public static bool TryParse(int statusCode, out HttpStatusCodeException httpStatusCodeException)
Parameters
statusCodeintThe HTTP status code to associate with this exception.
httpStatusCodeExceptionHttpStatusCodeExceptionWhen this method returns, contains the by
statusCoderesolved HttpStatusCodeException, ornullif no matches could be made.
Returns
- bool
trueif an instance of HttpStatusCodeException could be resolved,falseotherwise.
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
statusCodeintThe HTTP status code to associate with this exception.
messagestringThe message that describes the HTTP status code.
httpStatusCodeExceptionHttpStatusCodeExceptionWhen this method returns, contains the by
statusCoderesolved HttpStatusCodeException, ornullif no matches could be made.
Returns
- bool
trueif an instance of HttpStatusCodeException could be resolved,falseotherwise.
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
statusCodeintThe HTTP status code to associate with this exception.
messagestringThe message that describes the HTTP status code.
innerExceptionExceptionThe exception that is the cause of the current exception.
httpStatusCodeExceptionHttpStatusCodeExceptionWhen this method returns, contains the by
statusCoderesolved HttpStatusCodeException, ornullif no matches could be made.
Returns
- bool
trueif an instance of HttpStatusCodeException could be resolved,falseotherwise.