File: errors.go

package info (click to toggle)
incus 6.0.5-8
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 26,092 kB
  • sloc: sh: 16,313; ansic: 3,121; python: 457; makefile: 337; ruby: 51; sql: 50; lisp: 6
file content (30 lines) | stat: -rw-r--r-- 956 bytes parent folder | download | duplicates (4)
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
package drivers

import (
	"errors"
	"fmt"
)

// ErrUnknownDriver is the "Unknown driver" error.
var ErrUnknownDriver = errors.New("Unknown driver")

// ErrNotSupported is the "Not supported" error.
var ErrNotSupported = errors.New("Not supported")

// ErrCannotBeShrunk is the "Cannot be shrunk" error.
var ErrCannotBeShrunk = errors.New("Cannot be shrunk")

// ErrInUse indicates operation cannot proceed as resource is in use.
var ErrInUse = errors.New("In use")

// ErrSnapshotDoesNotMatchIncrementalSource in the "Snapshot does not match incremental source" error.
var ErrSnapshotDoesNotMatchIncrementalSource = errors.New("Snapshot does not match incremental source")

// ErrDeleteSnapshots is a special error used to tell the backend to delete more recent snapshots.
type ErrDeleteSnapshots struct {
	Snapshots []string
}

func (e ErrDeleteSnapshots) Error() string {
	return fmt.Sprintf("More recent snapshots must be deleted: %+v", e.Snapshots)
}