Skip to main content
Version: 1.33.0 (latest) View Markdown

Errors

New to the SDK? Getting started shows how to connect and use it.

DlthubError​

Base for every error that the SDK raises.

Attributes

NameTypeDescription
messagestrHuman-readable description.
codestr | NoneStable error code of the runtime, when the response carried one. Unlike message, it does not change between releases.
statusint | NoneHTTP status that the server returned, when known.
fieldstuple[FieldError, ...]Per-field reasons, when the runtime reported any.
client_updateClientUpdate | NoneSet when the failing response advertised a minimum client version newer than the installed one. This is a likely cause of the failure.

ApiError​

Subclass of DlthubError.

The runtime rejected the request or returned an unusable response.

BadRequest​

Subclass of ApiError.

The runtime rejected the request itself. The same request fails again.

message says why. code names the reason when the runtime gave one, and fields carries the per-field reasons when the runtime named any. The SDK also raises it before it sends a request, when an argument cannot form one, for example an ID that is not a UUID. status is then None.

InvalidResponse​

Subclass of ApiError.

A response did not parse, or broke an invariant that the SDK depends on.

ServerError​

Subclass of ApiError.

The server failed to handle the request. A retry can succeed.

Conflict​

Subclass of DlthubError.

The current state does not allow the call, for example an archived workspace.

code names the reason when the runtime gave one (workspace_archived, upstream_not_fresh, ...), and message describes it. The set of reasons grows with the runtime, so code is more specific than this class.

NotAuthenticated​

Subclass of DlthubError.

The credential is missing, malformed, or rejected.

DataplaneTokenRejected​

Subclass of NotAuthenticated.

The data plane rejected the short-lived token that the runtime issued for it.

The runtime accepted the credential of the caller, which got that token, so a renewed or new credential does not help. For regular calls, the SDK already got a new token and retried once. The SDK does not retry an upload.

NotAuthorized​

Subclass of DlthubError.

The caller is authenticated but lacks the access that the call needs.

message says what is missing.

NotFound​

Subclass of DlthubError.

The addressed resource does not exist.

Attributes

NameTypeDescription
kindEntityKindThe kind of entity that the call looked for.
refstr | NoneThe ID or name that the call did not find, or None when the call addressed no particular one.
codestr | NoneStable error code of the runtime, when the response carried one.
statusint | NoneHTTP status that the server returned, when known.
fieldstuple[FieldError, ...]Per-field reasons, when the runtime reported any.
client_updateClientUpdate | NoneAs for DlthubError.

ScopeMissing​

Subclass of DlthubError.

The call needs an organization or workspace that the caller did not give.

An example is runtime.workspaces.list() with no organization_id, at connect time or as an argument.

TransportError​

Subclass of DlthubError.

The request did not produce a response.

This error cannot tell if the request reached the runtime. As a result, the outcome of a mutation is unknown.

ConnectionFailed​

Subclass of TransportError.

The SDK did not reach the runtime.

TransportTimeout​

Subclass of TransportError.

An upload or log stream exceeded its time limit.

Other requests have no client-side timeout.

UnboundEntity​

Subclass of DlthubError.

The object was constructed directly, so it cannot call the runtime.

Only an object that the SDK returns can call the runtime. The class is also an AttributeError, so hasattr keeps working.

WaitTimeout​

Subclass of DlthubError.

The awaited state did not settle before the deadline. Nothing failed.

ClientUpdate​

The runtime requires a newer dlthub-client than the installed one.

Attributes

NameTypeDescription
installedstrThe installed version.
minimumstrThe lowest version that the runtime supports.

ClientUpdate.from_headers()​

from_headers(headers: Mapping[str, str]) -> ClientUpdate | None

Read the minimum client version of the runtime from one response.

Arguments

NameTypeDescription
headersMapping[str, str]The response headers, looked up case-insensitively.

Returns: ClientUpdate | None — The update, or None when the installed version is not older than the advertised minimum, or the response advertised none.

FieldError​

One reason that the runtime gave for a rejected request.

Attributes

NameTypeDescription
keystr | NoneThe field at fault, when the runtime named one.
messagestrWhat is wrong with it.

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.