forked from hyperledger/fabric
-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
128 lines (91 loc) · 3.57 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package lscc
import "fmt"
//InvalidFunctionErr invalid function error
type InvalidFunctionErr string
func (f InvalidFunctionErr) Error() string {
return fmt.Sprintf("invalid function to lscc %s", string(f))
}
//InvalidArgsLenErr invalid arguments length error
type InvalidArgsLenErr int
func (i InvalidArgsLenErr) Error() string {
return fmt.Sprintf("invalid number of argument to lscc %d", int(i))
}
//TXNotFoundErr transaction not found error
type TXNotFoundErr string
func (t TXNotFoundErr) Error() string {
return fmt.Sprintf("transaction not found %s", string(t))
}
//InvalidDeploymentSpecErr invalid chaincode deployment spec error
type InvalidDeploymentSpecErr string
func (f InvalidDeploymentSpecErr) Error() string {
return fmt.Sprintf("invalid deployment spec : %s", string(f))
}
//ExistsErr chaincode exists error
type ExistsErr string
func (t ExistsErr) Error() string {
return fmt.Sprintf("chaincode exists %s", string(t))
}
//NotFoundErr chaincode not registered with LSCC error
type NotFoundErr string
func (t NotFoundErr) Error() string {
return fmt.Sprintf("could not find chaincode with name '%s'", string(t))
}
//InvalidChainNameErr invalid chain name error
type InvalidChainNameErr string
func (f InvalidChainNameErr) Error() string {
return fmt.Sprintf("invalid chain name %s", string(f))
}
//InvalidChaincodeNameErr invalid chaincode name error
type InvalidChaincodeNameErr string
func (f InvalidChaincodeNameErr) Error() string {
return fmt.Sprintf("invalid chaincode name '%s'. Names can only consist of alphanumerics, '_', and '-'", string(f))
}
//EmptyChaincodeNameErr trying to upgrade to same version of Chaincode
type EmptyChaincodeNameErr string
func (f EmptyChaincodeNameErr) Error() string {
return fmt.Sprint("chaincode name not provided")
}
//InvalidVersionErr invalid version error
type InvalidVersionErr string
func (f InvalidVersionErr) Error() string {
return fmt.Sprintf("invalid chaincode version '%s'. Versions can only consist of alphanumerics, '_', '-', '+', and '.'", string(f))
}
//InvalidStatedbArtifactsErr invalid state database artifacts error
type InvalidStatedbArtifactsErr string
func (f InvalidStatedbArtifactsErr) Error() string {
return fmt.Sprintf("invalid state database artifact: %s", string(f))
}
//ChaincodeMismatchErr chaincode name from two places don't match
type ChaincodeMismatchErr string
func (f ChaincodeMismatchErr) Error() string {
return fmt.Sprintf("chaincode name mismatch %s", string(f))
}
//EmptyVersionErr empty version error
type EmptyVersionErr string
func (f EmptyVersionErr) Error() string {
return fmt.Sprintf("version not provided for chaincode with name '%s'", string(f))
}
//MarshallErr error marshaling/unmarshalling
type MarshallErr string
func (m MarshallErr) Error() string {
return fmt.Sprintf("error while marshalling %s", string(m))
}
//IdenticalVersionErr trying to upgrade to same version of Chaincode
type IdenticalVersionErr string
func (f IdenticalVersionErr) Error() string {
return fmt.Sprintf("version already exists for chaincode with name '%s'", string(f))
}
//InvalidCCOnFSError error due to mismatch between fingerprint on lscc and installed CC
type InvalidCCOnFSError string
func (f InvalidCCOnFSError) Error() string {
return fmt.Sprintf("chaincode fingerprint mismatch %s", string(f))
}
//InstantiationPolicyMissing when no existing instantiation policy is found when upgrading CC
type InstantiationPolicyMissing string
func (f InstantiationPolicyMissing) Error() string {
return "instantiation policy missing"
}