Table of Contents

Class OpenBiApiException

Namespace
BiExcellence.OpenBi.Api
Assembly
BiExcellence.OpenBi.Api.Client.dll

Thrown when the OpenBI REST API returns a non-success HTTP status code.

public sealed class OpenBiApiException : Exception
Inheritance
object
Exception
OpenBiApiException

Constructors

OpenBiApiException(int, string, string?, IReadOnlyDictionary<string, string[]>?, string?)

Creates the exception for a failed call.

public OpenBiApiException(int statusCode, string message, string? errorCode = null, IReadOnlyDictionary<string, string[]>? validationErrors = null, string? rawResponseBody = null)

Parameters

statusCode int

The HTTP status code the server returned; 0 where the call succeeded but the response was empty where a body was expected.

message string

The error message - the server's own where it sent one.

errorCode string

The machine-readable error code, see ErrorCode.

validationErrors IReadOnlyDictionary<string, string[]>

The per-field validation errors, see ValidationErrors.

rawResponseBody string

The raw response body, see RawResponseBody.

Properties

ErrorCode

The machine-readable error code, when the server returned one. For OAuth2 endpoints this is the standard error value (e.g. invalid_grant); for other endpoints it is usually unset (see ValidationErrors instead).

public string? ErrorCode { get; }

Property Value

string

RawResponseBody

The raw, unparsed response body, when available. Useful for diagnostics.

public string? RawResponseBody { get; }

Property Value

string

StatusCode

The HTTP status code returned by the server.

public int StatusCode { get; }

Property Value

int

ValidationErrors

Per-field validation errors, when the server returned an ASP.NET Core ValidationProblem (HTTP 400).

public IReadOnlyDictionary<string, string[]>? ValidationErrors { get; }

Property Value

IReadOnlyDictionary<string, string[]>