-
Notifications
You must be signed in to change notification settings - Fork 137
rfq+rfqmsg: add structured price oracle error codes #1766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
279f58a
7de8c85
da08866
dbb21f3
34dfdeb
966f761
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -76,22 +76,42 @@ func (v *RejectErr) Record() tlv.Record { | |
| ) | ||
| } | ||
|
|
||
| const ( | ||
| // UnspecifiedRejectCode indicates that a request-for-quote was | ||
| // rejected, without necessarily providing any further detail as to | ||
| // why. | ||
| UnspecifiedRejectCode uint8 = iota | ||
|
|
||
| // UnavailableRejectCode indicates that a request-for-quote was | ||
| // rejected as a price oracle was unavailable. | ||
| UnavailableRejectCode | ||
| ) | ||
|
Comment on lines
+79
to
+88
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It’s better, in my view, not to use
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we turn this set of const values into a
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should make the name more specific than |
||
|
|
||
| var ( | ||
| // ErrUnknownReject is the error code for when the quote is rejected | ||
| // for an unspecified reason. | ||
| ErrUnknownReject = RejectErr{ | ||
| Code: 0, | ||
| Code: UnspecifiedRejectCode, | ||
| Msg: "unknown reject error", | ||
| } | ||
|
|
||
| // ErrPriceOracleUnavailable is the error code for when the price oracle | ||
| // is unavailable. | ||
| // ErrPriceOracleUnavailable is the error code for when the price | ||
| // oracle is unavailable. | ||
| ErrPriceOracleUnavailable = RejectErr{ | ||
| Code: 1, | ||
| Code: UnavailableRejectCode, | ||
| Msg: "price oracle unavailable", | ||
| } | ||
| ) | ||
|
|
||
| // NewRejectErr produces the "unknown" error code, but pairs it with a | ||
| // custom error message. | ||
| func NewRejectErr(msg string) RejectErr { | ||
| return RejectErr{ | ||
| Code: UnspecifiedRejectCode, | ||
| Msg: msg, | ||
| } | ||
| } | ||
|
|
||
| const ( | ||
| // latestRejectVersion is the latest supported reject wire message data | ||
| // field version. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment here re
iota