Table of Contents

Class KeycloakHttpClientException

Namespace
Keycloak.AuthServices.Sdk
Assembly
Keycloak.AuthServices.Sdk.dll

Represents an exception that is thrown when an HTTP request to the Keycloak fails.

public class KeycloakHttpClientException : Exception, ISerializable
Inheritance
KeycloakHttpClientException
Implements
Inherited Members

Constructors

KeycloakHttpClientException(string, int, string, ErrorResponse, Exception?)

Initializes a new instance of the KeycloakHttpClientException class with the specified parameters.

public KeycloakHttpClientException(string message, int statusCode, string httpResponse, ErrorResponse response, Exception? innerException)

Parameters

message string

The error message.

statusCode int

The status code of the HTTP response.

httpResponse string

The raw HTTP response.

response ErrorResponse

The deserialized error response from the Keycloak server.

innerException Exception

The inner exception that caused this exception, or null if no inner exception is specified.

Properties

HttpResponse

Gets the raw HTTP response.

public string HttpResponse { get; }

Property Value

string

Response

Gets the deserialized error response from the Keycloak server.

public ErrorResponse Response { get; }

Property Value

ErrorResponse

StatusCode

Gets the status code of the HTTP response.

public int StatusCode { get; }

Property Value

int

Methods

ToString()

Returns a string that represents the current object, including the HTTP response.

public override string ToString()

Returns

string

A string that represents the current object, including the HTTP response.