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.

brief: str
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.

brief: str
exception craft_parts.errors.CopyTreeError(message)[source]

Bases: PartsError

Failed to copy or link a file tree.

Parameters:

message (str) – The error message.

brief: str
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) –

brief: str
exception craft_parts.errors.FeatureError(message)[source]

Bases: PartsError

A feature is not configured as expected.

Parameters:

message (str) –

brief: 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.

brief: str
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.

brief: str
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.

brief: str
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.

brief: str
exception craft_parts.errors.InvalidApplicationName(name)[source]

Bases: PartsError

The application name contains invalid characters.

Parameters:

name (str) – The invalid application name.

brief: str
exception craft_parts.errors.InvalidArchitecture(arch_name)[source]

Bases: PartsError

The machine architecture is not supported.

Parameters:

arch_name (str) – The unsupported architecture name.

brief: str
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.

brief: str
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.

brief: str
exception craft_parts.errors.InvalidPartitionError(partition, path, valid_partitions)[source]

Bases: PartitionError

Partition is not valid for this application.

Parameters:
  • partition (str) –

  • path (Union[str, Path]) –

  • valid_partitions (Iterable[str]) –

brief: str
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.

brief: str
exception craft_parts.errors.OsReleaseCodenameError[source]

Bases: PartsError

Failed to determine the host operating system version codename.

brief: str
exception craft_parts.errors.OsReleaseIdError[source]

Bases: PartsError

Failed to determine the host operating system identification string.

brief: str
exception craft_parts.errors.OsReleaseNameError[source]

Bases: PartsError

Failed to determine the host operating system name.

brief: str
exception craft_parts.errors.OsReleaseVersionIdError[source]

Bases: PartsError

Failed to determine the host operating system version.

brief: str
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) –

brief: str
exception craft_parts.errors.OverlayPermissionError[source]

Bases: PartsError

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

brief: str
exception craft_parts.errors.OverlayPlatformError[source]

Bases: PartsError

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

brief: str
exception craft_parts.errors.PartDependencyCycle[source]

Bases: PartsError

A dependency cycle has been detected in the parts definition.

brief: str
exception craft_parts.errors.PartFilesConflict(*, part_name, other_part_name, conflicting_files)[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.

brief: str
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.

brief: str
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(partition, brief, *, details=None, resolution=None)[source]

Bases: PartsError

Errors related to partitions.

Parameters:
  • partition (str) –

  • brief (str) –

  • details (Optional[str]) –

  • resolution (Optional[str]) –

brief: str
exception craft_parts.errors.PartitionWarning(partition, brief, *, details=None, resolution=None)[source]

Bases: PartitionError, Warning

Warnings for partition-related items.

Parameters:
  • partition (str) –

  • brief (str) –

  • details (Optional[str]) –

  • resolution (Optional[str]) –

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

Bases: Exception

Unexpected error.

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

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

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

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

Bases: PartsError

Plugin build script failed at runtime.

Parameters:

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

brief: str
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.

brief: str
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) –

brief: 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.

brief: str
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.

brief: str
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.

brief: str
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.

brief: str
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.

brief: str
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.

brief: str
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.

brief: str
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.

brief: str