-
Notifications
You must be signed in to change notification settings - Fork 0
/
errors.go
56 lines (45 loc) · 1.23 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
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package errors
// TxValidationError marks that the error is related to
// validation of a transaction
type TxValidationError interface {
error
IsValid() bool
}
// VSCCInfoLookupFailureError error to indicate inability
// to obtain VSCC information from LCCC
type VSCCInfoLookupFailureError struct {
Reason string
}
// Error returns reasons which lead to the failure
func (e VSCCInfoLookupFailureError) Error() string {
return e.Reason
}
// VSCCEndorsementPolicyError error to mark transaction
// failed endorsement policy check
type VSCCEndorsementPolicyError struct {
Err error
}
func (e *VSCCEndorsementPolicyError) IsValid() bool {
return e.Err == nil
}
// Error returns reasons which lead to the failure
func (e VSCCEndorsementPolicyError) Error() string {
return e.Err.Error()
}
// VSCCExecutionFailureError error to indicate
// failure during attempt of executing VSCC
// endorsement policy check
type VSCCExecutionFailureError struct {
Err error
}
// Error returns reasons which lead to the failure
func (e VSCCExecutionFailureError) Error() string {
return e.Err.Error()
}
func (e *VSCCExecutionFailureError) IsValid() bool {
return e.Err == nil
}