diff options
| author | 2026-03-30 14:28:13 +0000 | |
|---|---|---|
| committer | 2026-03-30 14:28:13 +0000 | |
| commit | a4eeb727468a178a4de0dfc718828f26740484ac (patch) | |
| tree | 4318d38d49facc80e2e2186f5919fa656be3b31f /object/store/packed/internal/ingest/errors.go | |
| parent | object/store/packed: Make store own root, algo, opts (diff) | |
| signature | No signature | |
object,store/packed{,/internal/ingest}: Move from format/packfile/ingest
Diffstat (limited to 'object/store/packed/internal/ingest/errors.go')
| -rw-r--r-- | object/store/packed/internal/ingest/errors.go | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/object/store/packed/internal/ingest/errors.go b/object/store/packed/internal/ingest/errors.go new file mode 100644 index 00000000..cbad1e77 --- /dev/null +++ b/object/store/packed/internal/ingest/errors.go @@ -0,0 +1,68 @@ +package ingest + +import ( + "errors" + "fmt" +) + +// InvalidPackHeaderError reports an invalid or unsupported pack header. +type InvalidPackHeaderError struct { + Reason string +} + +// Error implements error. +func (err *InvalidPackHeaderError) Error() string { + return "packfile/ingest: invalid pack header: " + err.Reason +} + +// PackTrailerMismatchError reports a mismatch between computed and trailer pack hash. +type PackTrailerMismatchError struct{} + +// Error implements error. +func (err *PackTrailerMismatchError) Error() string { + return "packfile/ingest: pack trailer hash mismatch" +} + +// ThinPackUnresolvedError reports unresolved REF deltas when fixThin is disabled +// or when required bases cannot be found in base. +type ThinPackUnresolvedError struct { + Count int +} + +// Error implements error. +func (err *ThinPackUnresolvedError) Error() string { + return fmt.Sprintf("packfile/ingest: unresolved thin deltas: %d", err.Count) +} + +// MalformedPackEntryError reports malformed entry encoding at one pack offset. +type MalformedPackEntryError struct { + Offset uint64 + Reason string +} + +// Error implements error. +func (err *MalformedPackEntryError) Error() string { + return fmt.Sprintf("packfile/ingest: malformed pack entry at offset %d: %s", err.Offset, err.Reason) +} + +// DeltaCycleError reports a detected cycle in delta dependency resolution. +type DeltaCycleError struct { + Offset uint64 +} + +// Error implements error. +func (err *DeltaCycleError) Error() string { + return fmt.Sprintf("packfile/ingest: delta cycle detected at offset %d", err.Offset) +} + +// DestinationWriteError reports destination I/O failures. +type DestinationWriteError struct { + Op string +} + +// Error implements error. +func (err *DestinationWriteError) Error() string { + return "packfile/ingest: destination write failure: " + err.Op +} + +var errExternalThinBase = errors.New("packfile/ingest: external thin base required") |
