Exceptions
Exceptions in the .NET SDK.
| Symbol | Kind | Summary |
|---|---|---|
NexusApiException | class | A non-success response from the API. |
NexusAuthenticationException | class | 401 — the API key is missing, malformed, or revoked. |
NexusBillingSuspendedException | class | 402 — the organisation's data plane is suspended for unpaid invoices. |
NexusConfigurationException | class | The SDK was configured wrongly: no API key, a malformed origin, and so on. |
NexusException | class | Base class for every failure the SDK raises, so one catch contains it. |
NexusNotFoundException | class | 404 — no such resource in this environment. |
NexusPermissionDeniedException | class | 403 — the key is valid but not allowed to do this. |
NexusRateLimitException | class | 429 — too many requests. |
NexusServerException | class | 5xx — the API failed. |
NexusTransportException | class | A network-level failure: DNS, refused connection, TLS, or a timeout. |
NexusValidationException | class | 400 or 422 — the request body failed server-side validation. |
NexusApiException
classclass Inverge.Nexus.NexusApiExceptionA non-success response from the API.
Nexus answers failures with {"error":{"code","message","details"}}.
Those three land in Code, Message and
Details. Prefer matching on Code over the message:
codes are part of the contract, messages are not.
NexusApiException
constructornew NexusApiException(string message, int status, string? code = null, JsonNode? details = null, string? method = null, string? path = null, string? responseBody = null)Creates the exception.
Parameters
Prop
Type
Code
propertystring? Code { get; }The machine-readable error code, e.g. validation_failed.
Details
propertyJsonNode? Details { get; }Structured detail the server attached, when any.
Method
propertystring? Method { get; }The HTTP method of the failed request.
Path
propertystring? Path { get; }The path of the failed request.
ResponseBody
propertystring? ResponseBody { get; }The raw response body, truncated.
Status
propertyint Status { get; }The HTTP status code.
NexusAuthenticationException
classclass Inverge.Nexus.NexusAuthenticationException401 — the API key is missing, malformed, or revoked.
NexusAuthenticationException
constructornew NexusAuthenticationException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody)Creates the exception.
Parameters
Prop
Type
NexusBillingSuspendedException
classclass Inverge.Nexus.NexusBillingSuspendedException402 — the organisation's data plane is suspended for unpaid invoices.
Every /partner/* endpoint answers this while an organisation has
invoices past due beyond the grace period; the control plane and payment
callbacks stay open. Retrying cannot help, so the SDK never does: catch this
distinctly from an authentication failure and surface it to whoever can pay
the bill.
NexusBillingSuspendedException
constructornew NexusBillingSuspendedException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody)Creates the exception.
Parameters
Prop
Type
NexusConfigurationException
classclass Inverge.Nexus.NexusConfigurationExceptionThe SDK was configured wrongly: no API key, a malformed origin, and so on.
NexusConfigurationException
constructornew NexusConfigurationException(string message)Creates the exception.
Parameters
Prop
Type
NexusConfigurationException
constructornew NexusConfigurationException(string message, Exception? innerException)Creates the exception with an underlying cause.
Parameters
Prop
Type
NexusException
classclass Inverge.Nexus.NexusExceptionBase class for every failure the SDK raises, so one catch contains it.
NexusException
constructornew NexusException(string message)Creates the exception.
Parameters
Prop
Type
NexusException
constructornew NexusException(string message, Exception? innerException)Creates the exception with an underlying cause.
Parameters
Prop
Type
NexusNotFoundException
classclass Inverge.Nexus.NexusNotFoundException404 — no such resource in this environment.
NexusNotFoundException
constructornew NexusNotFoundException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody)Creates the exception.
Parameters
Prop
Type
NexusPermissionDeniedException
classclass Inverge.Nexus.NexusPermissionDeniedException403 — the key is valid but not allowed to do this.
NexusPermissionDeniedException
constructornew NexusPermissionDeniedException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody)Creates the exception.
Parameters
Prop
Type
NexusRateLimitException
classclass Inverge.Nexus.NexusRateLimitException429 — too many requests.
NexusRateLimitException
constructornew NexusRateLimitException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody, TimeSpan? retryAfter)Creates the exception.
Parameters
Prop
Type
RetryAfter
propertyTimeSpan? RetryAfter { get; }How long the server asked us to wait, when it said.
NexusServerException
classclass Inverge.Nexus.NexusServerException5xx — the API failed. Idempotent calls are safe to repeat.
NexusServerException
constructornew NexusServerException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody)Creates the exception.
Parameters
Prop
Type
NexusTransportException
classclass Inverge.Nexus.NexusTransportExceptionA network-level failure: DNS, refused connection, TLS, or a timeout. The
original exception is in InnerException.
NexusTransportException
constructornew NexusTransportException(string message, Exception? innerException = null)Creates the exception.
Parameters
Prop
Type
NexusValidationException
classclass Inverge.Nexus.NexusValidationException400 or 422 — the request body failed server-side validation.
NexusValidationException
constructornew NexusValidationException(string message, int status, string? code, JsonNode? details, string? method, string? path, string? responseBody)Creates the exception.
Parameters
Prop
Type
