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
-
objectExceptionOpenBiApiException
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
statusCodeintThe HTTP status code the server returned;
0where the call succeeded but the response was empty where a body was expected.messagestringThe error message - the server's own where it sent one.
errorCodestringThe machine-readable error code, see ErrorCode.
validationErrorsIReadOnlyDictionary<string, string[]>The per-field validation errors, see ValidationErrors.
rawResponseBodystringThe 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[]>