File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,26 @@ const (
86
86
// service.
87
87
type OracleError struct {
88
88
// Code is a code which uniquely identifies the error type.
89
- Code uint8
89
+ Code OracleErrorCode
90
90
91
91
// Msg is a human-readable error message.
92
92
Msg string
93
93
}
94
94
95
+ // OracleErrorCode uniquely identifies the kinds of error an oracle may
96
+ // return.
97
+ type OracleErrorCode uint8
98
+
99
+ const (
100
+ // ErrUnspecifiedOracleError represents the case where the oracle has
101
+ // declined to give a more specific reason for the error.
102
+ ErrUnspecifiedOracleError OracleErrorCode = iota
103
+
104
+ // ErrUnsupportedOracleAsset represents the case in which an oracle does
105
+ // not provide quotes for the requested asset.
106
+ ErrUnsupportedOracleAsset
107
+ )
108
+
95
109
// Error returns a human-readable string representation of the error.
96
110
func (o * OracleError ) Error () string {
97
111
// Sanitise price oracle error message by truncating to 255 characters.
You can’t perform that action at this time.
0 commit comments