Exceptions

Custom Dagger exceptions.

exception dagger.DaggerError

Bases: Exception

Base exception for all Dagger exceptions.

Client execution

exception dagger.QueryError(errors: list[QueryErrorValue], *_)

Bases: ClientError

The server returned an error for a specific query.

debug_query()[source]

Return GraphQL query for debugging purposes.

Example:

try:
    await ctr
except dagger.QueryError as e:
    print(e.debug_query())
exception dagger.ExecError(errors: list[QueryErrorValue], *_)

Bases: QueryError

API error from an exec operation.

command

The command that was executed.

Type:

list[str]

message

The error message.

Type:

str

exit_code

The exit code of the command.

Type:

int

stdout

The stdout of the command.

Type:

str

stderr

The stderr of the command.

Type:

str

__str__()[source]

Prints the error message with stdout and stderr.

Client connection

exception dagger.ClientError

Bases: DaggerError

Base class for client errors.

exception dagger.ClientConnectionError

Bases: ClientError

Error while establishing a client connection to the server.

exception dagger.TransportError

Bases: ClientError

Error processing request/response during query execution.

exception dagger.ExecuteTimeoutError

Bases: TransportError

Timeout while executing a query.

exception dagger.InvalidQueryError

Bases: ClientError

Misuse of the query builder.

Engine provisioning

exception dagger.ProvisionError

Bases: DaggerError

Error while provisioning the Dagger engine.

exception dagger.DownloadError

Bases: ProvisionError

Error while downloading the Dagger CLI.

exception dagger.SessionError

Bases: ProvisionError

Error while starting an engine session.

Warnings

exception dagger.VersionMismatch

Bases: Warning

Dagger CLI version doesn’t match required version.