duck.cli.commands.sync.exceptions

Exceptions raised by Duck Sync.

Module Contents

API

exception duck.cli.commands.sync.exceptions.ConfigNotFoundError[source]

Bases: duck.cli.commands.sync.exceptions.DuckSyncError

Raised when no duck.toml can be located.

Typically thrown by :func:~duck_sync.config.find_config after walking up to the filesystem root without finding the config file.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception duck.cli.commands.sync.exceptions.ConfigParseError[source]

Bases: duck.cli.commands.sync.exceptions.DuckSyncError

Raised when duck.toml exists but cannot be parsed.

Wraps a :class:tomllib.TOMLDecodeError with a message that includes the offending file path.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception duck.cli.commands.sync.exceptions.DuckSyncError[source]

Bases: Exception

Base class for all Duck Sync errors.

Catch this to handle any failure Duck Sync can raise without importing each subclass individually.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception duck.cli.commands.sync.exceptions.InstallationError(package: str, reason: str)[source]

Bases: duck.cli.commands.sync.exceptions.DuckSyncError

Raised when a package manager command exits non-zero.

Parameters:
  • package – The package name (or requirements file label) that failed to install.

  • reason – The stderr output from the failed command, or a short fallback string when stderr was empty.

Initialization

Initialize self. See help(type(self)) for accurate signature.

exception duck.cli.commands.sync.exceptions.UnsupportedPlatformError[source]

Bases: duck.cli.commands.sync.exceptions.DuckSyncError

Raised when no supported package manager can be found on the host.

Thrown by :func:~duck_sync.platform_utils.detect_backend_name when the OS family is unrecognised or none of the known package manager binaries are on PATH.

Initialization

Initialize self. See help(type(self)) for accurate signature.