Debian Codegraph @

errors.go

raw
1 // Copyright The Notary Project Authors.
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13
14 package notation
15
16 // ErrorPushSignatureFailed is used when failed to push signature to the
17 // target registry.
18 //
19 // Deprecated: Use PushSignatureFailedError instead.
20 type ErrorPushSignatureFailed = PushSignatureFailedError
21
22 // PushSignatureFailedError is used when failed to push signature to the
23 // target registry.
24 type PushSignatureFailedError struct {
25 Msg string
26 }
27
28 func (e PushSignatureFailedError) Error() string {
29 if e.Msg != "" {
30 return "failed to push signature to registry with error: " + e.Msg
31 }
32 return "failed to push signature to registry"
33 }
34
35 // ErrorVerificationInconclusive is used when signature verification fails due
36 // to a runtime error (e.g. a network error)
37 //
38 // Deprecated: Use VerificationInconclusiveError instead.
39 type ErrorVerificationInconclusive = VerificationInconclusiveError
40
41 // VerificationInconclusiveError is used when signature verification fails due
42 // to a runtime error (e.g. a network error)
43 type VerificationInconclusiveError struct {
44 Msg string
45 }
46
47 func (e VerificationInconclusiveError) Error() string {
48 if e.Msg != "" {
49 return e.Msg
50 }
51 return "signature verification was inclusive due to an unexpected error"
52 }
53
54 // ErrorNoApplicableTrustPolicy is used when there is no trust policy that
55 // applies to the given artifact
56 //
57 // Deprecated: Use NoApplicableTrustPolicyError instead.
58 type ErrorNoApplicableTrustPolicy = NoApplicableTrustPolicyError
59
60 // NoApplicableTrustPolicyError is used when there is no trust policy that
61 // applies to the given artifact
62 type NoApplicableTrustPolicyError struct {
63 Msg string
64 }
65
66 func (e NoApplicableTrustPolicyError) Error() string {
67 if e.Msg != "" {
68 return e.Msg
69 }
70 return "there is no applicable trust policy for the given artifact"
71 }
72
73 // ErrorSignatureRetrievalFailed is used when notation is unable to retrieve the
74 // digital signature/s for the given artifact
75 //
76 // Deprecated: Use SignatureRetrievalFailedError instead.
77 type ErrorSignatureRetrievalFailed = SignatureRetrievalFailedError
78
79 // SignatureRetrievalFailedError is used when notation is unable to retrieve the
80 // digital signature/s for the given artifact
81 type SignatureRetrievalFailedError struct {
82 Msg string
83 }
84
85 func (e SignatureRetrievalFailedError) Error() string {
86 if e.Msg != "" {
87 return e.Msg
88 }
89 return "unable to retrieve the digital signature from the registry"
90 }
91
92 // ErrorVerificationFailed is used when it is determined that the digital
93 // signature/s is not valid for the given artifact
94 //
95 // Deprecated: Use VerificationFailedError instead.
96 type ErrorVerificationFailed = VerificationFailedError
97
98 // VerificationFailedError is used when it is determined that the digital
99 // signature/s is not valid for the given artifact
100 type VerificationFailedError struct {
101 Msg string
102 }
103
104 func (e VerificationFailedError) Error() string {
105 if e.Msg != "" {
106 return e.Msg
107 }
108 return "signature verification failed"
109 }
110
111 // ErrorUserMetadataVerificationFailed is used when the signature does not
112 // contain the user specified metadata
113 //
114 // Deprecated: Use UserMetadataVerificationFailedError instead.
115 type ErrorUserMetadataVerificationFailed = UserMetadataVerificationFailedError
116
117 // UserMetadataVerificationFailedError is used when the signature does not
118 // contain the user specified metadata
119 type UserMetadataVerificationFailedError struct {
120 Msg string
121 }
122
123 func (e UserMetadataVerificationFailedError) Error() string {
124 if e.Msg != "" {
125 return e.Msg
126 }
127 return "unable to find specified metadata in the signature"
128 }