craft_parts.errors module

Craft parts errors.

exception craft_parts.errors.CallbackRegistrationError(message)[source]

Bases: PartsError

Error in callback function registration.

Parameters:

message (str) – the error message.

exception craft_parts.errors.CopyFileNotFound(name)[source]

Bases: PartsError

An attempt was made to copy a file that doesn’t exist.

Parameters:

name (str) – The file name.

exception craft_parts.errors.CopyTreeError(message)[source]

Bases: PartsError

Failed to copy or link a file tree.

Parameters:

message (str) – The error message.

exception craft_parts.errors.DebError(deb_path, command, exit_code)[source]

Bases: PartsError

A “deb”-related command failed.

Parameters:
  • deb_path (Path)

  • command (list[str])

  • exit_code (int)

exception craft_parts.errors.FeatureError(message, details=None)[source]

Bases: PartsError

A feature is not configured as expected.

Parameters:
  • message (str)

  • details (Optional[str])

exception craft_parts.errors.FileOrganizeError(*, part_name, message)[source]

Bases: PartsError

Failed to organize a file layout.

Parameters:
  • part_name (str) – The name of the part being processed.

  • message (str) – The error message.

exception craft_parts.errors.FilesetConflict(conflicting_files)[source]

Bases: PartsError

Inconsistent stage to prime filtering.

Parameters:

conflicting_files (set[str]) – A set containing the conflicting file names.

exception craft_parts.errors.FilesetError(*, name, message)[source]

Bases: PartsError

An invalid fileset operation was performed.

Parameters:
  • name (str) – The name of the fileset.

  • message (str) – The error message.

exception craft_parts.errors.InvalidAction(message)[source]

Bases: PartsError

An attempt was made to execute an action with invalid parameters.

Parameters:

message (str) – The error message.

exception craft_parts.errors.InvalidApplicationName(name)[source]

Bases: PartsError

The application name contains invalid characters.

Parameters:

name (str) – The invalid application name.

exception craft_parts.errors.InvalidArchitecture(arch_name)[source]

Bases: PartsError

The machine architecture is not supported.

Parameters:

arch_name (str) – The unsupported architecture name.

exception craft_parts.errors.InvalidControlAPICall(*, part_name, scriptlet_name, message)[source]

Bases: PartsError

A control API call was made with invalid parameters.

Parameters:
  • part_name (str) – The name of the part being processed.

  • scriptlet_name (str) – The name of the scriptlet that originated the call.

  • message (str) – The error message.

exception craft_parts.errors.InvalidPartName(part_name)[source]

Bases: PartsError

An operation was requested on a part that’s not in the parts specification.

Parameters:

part_name (str) – The invalid part name.

exception craft_parts.errors.InvalidPlugin(plugin_name, *, part_name)[source]

Bases: PartsError

A request was made to use a plugin that’s not registered.

Parameters:
  • plugin_name (str) – The invalid plugin name.”

  • part_name (str) – The name of the part defining the invalid plugin.

exception craft_parts.errors.OsReleaseCodenameError[source]

Bases: PartsError

Failed to determine the host operating system version codename.

exception craft_parts.errors.OsReleaseIdError[source]

Bases: PartsError

Failed to determine the host operating system identification string.

exception craft_parts.errors.OsReleaseNameError[source]

Bases: PartsError

Failed to determine the host operating system name.

exception craft_parts.errors.OsReleaseVersionIdError[source]

Bases: PartsError

Failed to determine the host operating system version.

exception craft_parts.errors.OverlayPackageNotFound(*, part_name, package_name)[source]

Bases: PartsError

Failed to install an overlay package.

Parameters:
  • part_name (str) – The name of the part being processed.

  • message – the error message.

  • package_name (str)

exception craft_parts.errors.OverlayPermissionError[source]

Bases: PartsError

A project using overlays was processed by a non-privileged user.

exception craft_parts.errors.OverlayPlatformError[source]

Bases: PartsError

A project using overlays was processed on a non-Linux platform.

exception craft_parts.errors.PartDependencyCycle[source]

Bases: PartsError

A dependency cycle has been detected in the parts definition.

exception craft_parts.errors.PartFilesConflict(*, part_name, other_part_name, conflicting_files, partition=None)[source]

Bases: PartsError

Different parts list the same files with different contents.

Parameters:
  • part_name (str) – The name of the part being processed.

  • other_part_name (str) – The name of the conflicting part.

  • conflicting_files (list[str]) – The list of conflicting files.

  • partition (Optional[str]) – Optional name of the partition where the conflict occurred.

exception craft_parts.errors.PartSpecificationError(*, part_name, message)[source]

Bases: PartsError

A part was not correctly specified.

Parameters:
  • part_name (str) – The name of the part being processed.

  • message (str) – The error message.

classmethod from_validation_error(*, part_name, error_list)[source]

Create a PartSpecificationError from a pydantic error list.

Parameters:
  • part_name (str) – The name of the part being processed.

  • error_list (list[ErrorDict]) – A list of dictionaries containing pydantic error definitions.

Return type:

PartSpecificationError

exception craft_parts.errors.PartitionError(brief, *, details=None, resolution=None)[source]

Bases: PartsError

Errors related to partitions.

Parameters:
  • brief (str)

  • details (Optional[str])

  • resolution (Optional[str])

exception craft_parts.errors.PartitionNotFound(partition_name, partitions)[source]

Bases: PartitionUsageError

A partition has been specified that does not exist.

Parameters:
  • partition_name (str) – The name of the partition that does not exist.

  • partitions (Iterable[str]) – Iterable of the names of valid partitions.

exception craft_parts.errors.PartitionUsageError(error_list, partitions, brief=None)[source]

Bases: PartitionError

Error for a list of invalid partition usages.

Parameters:
  • error_list (Iterable[str]) – Iterable of strings describing the invalid usages.

  • partitions (Iterable[str] | None) – Iterable of the names of valid partitions.

  • brief (Optional[str]) – Override brief message.

exception craft_parts.errors.PartitionUsageWarning(warning_list)[source]

Bases: PartitionError, Warning

Warnings for possibly invalid usages of partitions.

Parameters:

warning_list (Iterable[str]) – Iterable of strings describing the misuses.

exception craft_parts.errors.PartsError(brief, details=None, resolution=None, doc_slug=None)[source]

Bases: Exception

Unexpected error.

Parameters:
  • brief (str) – Brief description of error.

  • details (Optional[str]) – Detailed information.

  • resolution (Optional[str]) – Recommendation, if any.

  • doc_slug (Optional[str]) – Reusable documentation slug for consumers adopting the Craft Parts documentation.

brief: str
details: str | None = None
doc_slug: str | None = None
resolution: str | None = None
exception craft_parts.errors.PluginBuildError(*, part_name, plugin_name)[source]

Bases: PartsError

Plugin build script failed at runtime.

Parameters:
  • part_name (str) – The name of the part being processed.

  • plugin_name (str) – The name of the plugin being processed.

exception craft_parts.errors.PluginCleanError(*, part_name)[source]

Bases: PartsError

Script to clean strict build preparation failed at runtime.

Parameters:

part_name (str) – The name of the part being processed.

exception craft_parts.errors.PluginEnvironmentValidationError(*, part_name, reason)[source]

Bases: PartsError

Plugin environment validation failed at runtime.

Parameters:
  • part_name (str) – The name of the part being processed.

  • reason (str)

exception craft_parts.errors.PluginNotStrict(plugin_name, *, part_name)[source]

Bases: PartsError

A request was made to use a plugin that’s not strict.

Parameters:
  • plugin_name (str) – The plugin name.

  • part_name (str) – The name of the part defining the plugin.

exception craft_parts.errors.PluginPullError(*, part_name)[source]

Bases: PartsError

Plugin pull script failed at runtime.

Parameters:

part_name (str) – The name of the part being processed.

exception craft_parts.errors.ScriptletRunError(*, part_name, scriptlet_name, exit_code)[source]

Bases: PartsError

A scriptlet execution failed.

Parameters:
  • part_name (str) – The name of the part being processed.

  • scriptlet_name (str) – The name of the scriptlet that failed to execute.

  • exit_code (int) – The execution error code.

exception craft_parts.errors.StageFilesConflict(*, part_name, conflicting_files)[source]

Bases: PartsError

Files from a part conflict with files already being staged.

Parameters:
  • part_name (str) – The name of the part being processed.

  • conflicting_files (list[str]) – The list of confictling files.

exception craft_parts.errors.StagePackageNotFound(*, part_name, package_name)[source]

Bases: PartsError

Failed to install a stage package.

Parameters:
  • part_name (str) – The name of the part being processed.

  • package_name (str) – The name of the package.

exception craft_parts.errors.UndefinedPlugin(*, part_name)[source]

Bases: PartsError

The part didn’t define a plugin and the part name is not a valid plugin name.

Parameters:

part_name (str) – The name of the part with no plugin definition.

exception craft_parts.errors.XAttributeError(key, path, is_write=False)[source]

Bases: PartsError

Failed to read or write an extended attribute.

Parameters:
  • action – The action being performed.

  • key (str) – The extended attribute key.

  • path (str) – The file path.

  • is_write (bool) – Whether this is an attribute write operation.

exception craft_parts.errors.XAttributeTooLong(key, value, path)[source]

Bases: PartsError

Failed to write an extended attribute because key and/or value is too long.

Parameters:
  • key (str) – The extended attribute key.

  • value (str) – The extended attribute value.

  • path (str) – The file path.