forked from notaryproject/notary
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
42 lines (33 loc) · 1.11 KB
/
errors.go
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
37
38
39
40
41
42
package storage
import (
"fmt"
)
// ErrOldVersion is returned when a newer version of TUF metadada is already available
type ErrOldVersion struct{}
// ErrOldVersion is returned when a newer version of TUF metadada is already available
func (err ErrOldVersion) Error() string {
return fmt.Sprintf("Error updating metadata. A newer version is already available")
}
// ErrNotFound is returned when TUF metadata isn't found for a specific record
type ErrNotFound struct{}
// Error implements error
func (err ErrNotFound) Error() string {
return fmt.Sprintf("No record found")
}
// ErrKeyExists is returned when a key already exists
type ErrKeyExists struct {
gun string
role string
}
// ErrKeyExists is returned when a key already exists
func (err ErrKeyExists) Error() string {
return fmt.Sprintf("Error, timestamp key already exists for %s:%s", err.gun, err.role)
}
// ErrNoKey is returned when no timestamp key is found
type ErrNoKey struct {
gun string
}
// ErrNoKey is returned when no timestamp key is found
func (err ErrNoKey) Error() string {
return fmt.Sprintf("Error, no timestamp key found for %s", err.gun)
}