#[non_exhaustive]pub enum ErrorCode {
Show 18 variants
Unauthenticated,
InvalidApiKey,
InvalidToken,
Forbidden,
Suspended,
NotFound,
Conflict,
ManagedRecord,
ManagedCertificate,
Validation,
ImportFailed,
DiscoveryFailed,
PayloadTooLarge,
AuditDisabled,
TelemetryDisabled,
BadRequest,
Internal,
Other(String),
}Expand description
error.code values Core sends (../core/src/api/errors.ts, auth.ts).
Unknown codes are kept as ErrorCode::Other so a newer Core never breaks parsing.
Non-exhaustive: new Core codes get their own variant in later SDK versions, so a
match needs a wildcard arm.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Unauthenticated
401: no credentials were sent (the client was built without an API key).
InvalidApiKey
401: the API key is unknown, was replaced or was revoked.
InvalidToken
401: the bearer token was taken as a JWT and rejected. Core takes anything without
the dz_/du_ prefix for a JWT, so this usually means a key Core did not issue
(see ApiKeyKind::of).
Forbidden
403: the key may not do this (wrong zone, not the owner, missing scope).
Suspended
403: the zone or client identity is suspended by an Admin (itself or through its owner). Reads still work, and so does deleting it; for a zone also removing a member and revoking its key.
NotFound
404: the resource does not exist, or is not visible to the key.
Conflict
409: already exists, still referenced, or a zone rule is violated (see
ApiError::details).
ManagedRecord
409: the record value is kept by Core for a redirect or a certificate issuance
(RecordValue::managed_by), or a user A/AAAA/CNAME would go where a redirect is.
ApiError::details is {managed_by, name}; change the redirect instead.
ManagedCertificate
409: the certificate was issued automatically for a redirect (source: Acme) and
cannot be replaced or deleted directly. ApiError::details is
{managed_by, name} with the redirect’s name; change the redirect’s tls instead.
Validation
422: the input failed validation; ApiError::details lists the issues.
ImportFailed
422: a zone import refused some records, so nothing was written;
ApiError::import_report has the full report.
DiscoveryFailed
422: zone discovery found no usable nameserver (typically the delegation already points to Dinio: give the previous provider’s nameservers).
PayloadTooLarge
413: the uploaded file is too large (zone import: 2 MiB).
AuditDisabled
503: this Core runs without the audit log.
TelemetryDisabled
503: this Core runs without telemetry, so there are no statistics.
BadRequest
400: the request body is not valid JSON.
Internal
500: an unexpected error inside Core.
Other(String)
A code this SDK version does not know yet, kept verbatim.
Implementations§
Trait Implementations§
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.