File: errors.go

package info (click to toggle)
docker.io 20.10.24%2Bdfsg1-1%2Bdeb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-proposed-updates
  • size: 60,824 kB
  • sloc: sh: 5,621; makefile: 593; ansic: 179; python: 162; asm: 7
file content (36 lines) | stat: -rw-r--r-- 1,227 bytes parent folder | download | duplicates (8)
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 graphdriver // import "github.com/docker/docker/daemon/graphdriver"

const (
	// ErrNotSupported returned when driver is not supported.
	ErrNotSupported NotSupportedError = "driver not supported"
	// ErrPrerequisites returned when driver does not meet prerequisites.
	ErrPrerequisites NotSupportedError = "prerequisites for driver not satisfied (wrong filesystem?)"
	// ErrIncompatibleFS returned when file system is not supported.
	ErrIncompatibleFS NotSupportedError = "backing file system is unsupported for this graph driver"
)

// ErrUnSupported signals that the graph-driver is not supported on the current configuration
type ErrUnSupported interface {
	NotSupported()
}

// NotSupportedError signals that the graph-driver is not supported on the current configuration
type NotSupportedError string

func (e NotSupportedError) Error() string {
	return string(e)
}

// NotSupported signals that a graph-driver is not supported.
func (e NotSupportedError) NotSupported() {}

// IsDriverNotSupported returns true if the error initializing
// the graph driver is a non-supported error.
func IsDriverNotSupported(err error) bool {
	switch err.(type) {
	case ErrUnSupported:
		return true
	default:
		return false
	}
}