packkit/error

Shared public error families for the packkit facade and the early scaffold modules.

Types

Errors returned by archive read/write APIs.

pub type ArchiveError {
  ArchiveUnsupported(name: String)
  ArchiveInvalid(message: String)
  ArchiveEntryRejected(path: String, reason: String)
  ArchiveLimitExceeded(limit: String, actual: Int)
  ArchiveNotImplemented(feature: String)
  ArchiveCodecFailed(step: String, cause: CodecError)
  ArchiveFormatMismatch(archive: String, requested: String)
  ArchiveFieldOverflow(field: String, value: Int, max: Int)
  ArchiveCommentUnsupported(format: String)
}

Constructors

  • ArchiveUnsupported(name: String)
  • ArchiveInvalid(message: String)
  • ArchiveEntryRejected(path: String, reason: String)
  • ArchiveLimitExceeded(limit: String, actual: Int)
  • ArchiveNotImplemented(feature: String)
  • ArchiveCodecFailed(step: String, cause: CodecError)

    Surfaces a structured codec failure that occurred during a recipe-driven pack/unpack step. Preserves the underlying CodecError so callers can pattern-match on it instead of parsing a flattened string. step is a short label such as “encode” or “decode”.

  • ArchiveFormatMismatch(archive: String, requested: String)

    The format requested for write/pack does not match the format stored on the supplied archive value. An Archive is an opaque value bound to one format at construction time; pretending it is a different format would silently corrupt the output, so the facade refuses up-front.

  • ArchiveFieldOverflow(field: String, value: Int, max: Int)

    A numeric metadata field (size, count, offset, timestamp, uid/gid, mode, …) is too large for the on-disk representation chosen by the format. Surfaced instead of silently truncating to the field’s modulus, which would corrupt the archive.

  • ArchiveCommentUnsupported(format: String)

    The supplied archive carries an optional comment but the destination format has no slot for it. Surfaced instead of silently dropping the comment on encode.

Errors returned by byte-to-byte codec APIs.

pub type CodecError {
  CodecInvalidData(message: String)
  CodecLimitExceeded(limit: String, actual: Int)
  CodecDictionaryRequired(name: String)
  CodecDictionaryMismatch(name: String)
  CodecOptionUnsupported(option: String, codec_name: String)
  CodecNotImplemented(feature: String)
}

Constructors

  • CodecInvalidData(message: String)
  • CodecLimitExceeded(limit: String, actual: Int)
  • CodecDictionaryRequired(name: String)
  • CodecDictionaryMismatch(name: String)
  • CodecOptionUnsupported(option: String, codec_name: String)

    The codec carries an option (level or preset dictionary) that the selected encoder/decoder cannot honour. Distinct from CodecNotImplemented so callers can tell “the codec is fundamentally unfinished” apart from “this combination of options is not supported by the current implementation”.

  • CodecNotImplemented(feature: String)

Errors returned by detection helpers.

pub type DetectError {
  DetectUnknownFormat(input: String)
  DetectNotImplemented(feature: String)
}

Constructors

  • DetectUnknownFormat(input: String)
  • DetectNotImplemented(feature: String)

Errors returned by recipe constructors or validators.

pub type RecipeError {
  RecipeArchiveAlreadySet(current: String)
  RecipeEmptyCodecChain
  RecipeUnsupportedComposition(description: String)
  RecipeNotImplemented(feature: String)
}

Constructors

  • RecipeArchiveAlreadySet(current: String)
  • RecipeEmptyCodecChain
  • RecipeUnsupportedComposition(description: String)
  • RecipeNotImplemented(feature: String)

Values

pub fn format_archive_error(err: ArchiveError) -> String

Format an ArchiveError as a single user-facing line. Nested CodecError (under ArchiveCodecFailed) is rendered through format_codec_error so the user sees one continuous sentence.

pub fn format_codec_error(err: CodecError) -> String

Format a CodecError as a single user-facing line. Hides the constructor names and field labels that string.inspect would expose, so the output is suitable for CLI error reporting.

pub fn format_detect_error(err: DetectError) -> String

Format a DetectError as a single user-facing line.

pub fn format_recipe_error(err: RecipeError) -> String

Format a RecipeError as a single user-facing line.

Search Document