File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -76,18 +76,29 @@ func (v *RejectErr) Record() tlv.Record {
7676 )
7777}
7878
79+ const (
80+ // UnspecifiedRejectCode indicates that a request-for-quote was
81+ // rejected, without necessarily providing any further detail as to
82+ // why.
83+ UnspecifiedRejectCode uint8 = iota
84+
85+ // UnavailableRejectCode indicates that a request-for-quote was
86+ // rejected as a price oracle was unavailable.
87+ UnavailableRejectCode
88+ )
89+
7990var (
8091 // ErrUnknownReject is the error code for when the quote is rejected
8192 // for an unspecified reason.
8293 ErrUnknownReject = RejectErr {
83- Code : 0 ,
94+ Code : UnspecifiedRejectCode ,
8495 Msg : "unknown reject error" ,
8596 }
8697
87- // ErrPriceOracleUnavailable is the error code for when the price oracle
88- // is unavailable.
98+ // ErrPriceOracleUnavailable is the error code for when the price
99+ // oracle is unavailable.
89100 ErrPriceOracleUnavailable = RejectErr {
90- Code : 1 ,
101+ Code : UnavailableRejectCode ,
91102 Msg : "price oracle unavailable" ,
92103 }
93104)
96107// it with a custom error message.
97108func ErrRejectWithCustomMsg (msg string ) RejectErr {
98109 return RejectErr {
99- Code : 0 ,
110+ Code : UnspecifiedRejectCode ,
100111 Msg : msg ,
101112 }
102113}
You can’t perform that action at this time.
0 commit comments