-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patherrors.go
82 lines (64 loc) · 1.54 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
package c_polygonid
import (
"errors"
"fmt"
)
type ErrCredentialStatus struct {
err error
owner CredentialStatusOwner
}
func (c ErrCredentialStatus) Error() string {
return fmt.Sprintf("credential status error: %v", c.err)
}
func (c ErrCredentialStatus) Unwrap() error {
return c.err
}
func (c ErrCredentialStatus) Owner() CredentialStatusOwner {
return c.owner
}
type ErrCredentialStatusResolve struct {
err error
}
func (e ErrCredentialStatusResolve) Error() string {
return fmt.Sprintf("credential status resolve error: %v", e.err)
}
func (e ErrCredentialStatusResolve) Unwrap() error {
return e.err
}
type ErrCredentialStatusExtract struct {
err error
}
func (e ErrCredentialStatusExtract) Error() string {
return fmt.Sprintf(
"error extracting credential status from verifiable credential: %v",
e.err)
}
func (e ErrCredentialStatusExtract) Unwrap() error {
return e.err
}
type ErrCredentialStatusTreeBuild struct {
err error
}
func (e ErrCredentialStatusTreeBuild) Error() string {
return fmt.Sprintf(
"error building tree proof from credential status: %v",
e.err)
}
func (e ErrCredentialStatusTreeBuild) Unwrap() error {
return e.err
}
type ErrCredentialStatusTreeState struct {
msg string
err error
}
func (e ErrCredentialStatusTreeState) Error() string {
m := "error validating credential status merkletree proof: " + e.msg
if e.err != nil {
m += ": " + e.err.Error()
}
return m
}
func (e ErrCredentialStatusTreeState) Unwrap() error {
return e.err
}
var ErrCredentialStatusRevoked = errors.New("credential is revoked")