aboutsummaryrefslogtreecommitdiff
path: root/object/store/packed/internal/ingest/errors.go
blob: e268182e0b27b17d02b0d8640b29211e28882e34 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package ingest

import (
	"errors"
	"fmt"

	"lindenii.org/go/furgit/object/id"
)

// ErrMalformedPack reports that
// the incoming pack stream is truncated,
// inconsistent, or otherwise unparseable.
var ErrMalformedPack = errors.New("object/store/packed/internal/ingest: malformed pack")

// ErrThinPackNotPermitted reports that
// the incoming pack is thin,
// referencing bases not contained within it,
// but no external base reader was supplied to complete it.
var ErrThinPackNotPermitted = errors.New("object/store/packed/internal/ingest: thin pack not permitted: no thin base supplied")

// ThinBasesMissingError reports that
// an incoming thin pack references base objects
// that the supplied thin base reader does not contain,
// so the pack cannot be completed.
type ThinBasesMissingError struct {
	// OIDs holds the missing base object IDs, sorted.
	OIDs []id.ObjectID
}

// Error implements error.
func (e *ThinBasesMissingError) Error() string {
	return fmt.Sprintf(
		"object/store/packed/internal/ingest: thin pack references %d missing base objects",
		len(e.OIDs),
	)
}