chore: Adding better errors for coinbase order errors#826
Merged
vslee merged 3 commits intoDigitalRuby:mainfrom Jan 23, 2024
Merged
chore: Adding better errors for coinbase order errors#826vslee merged 3 commits intoDigitalRuby:mainfrom
vslee merged 3 commits intoDigitalRuby:mainfrom
Conversation
O-Mutt
commented
Jan 23, 2024
O-Mutt
commented
Jan 23, 2024
Comment on lines
461
to
472
| return new ExchangeOrderResult(){ | ||
| Result = ExchangeAPIOrderResult.Rejected, | ||
| IsBuy = payload["side"].ToStringInvariant().Equals(BUY), | ||
| MarketSymbol = payload["product_id"].ToStringInvariant(), | ||
| ClientOrderId = order.ClientOrderId, | ||
| ResultCode = $"{token["error_response"]["error"].ToStringInvariant()} - {token["error_response"]["preview_failure_reason"].ToStringInvariant()}", | ||
| AmountFilled = 0, | ||
| Amount = order.Amount, | ||
| AveragePrice = 0, | ||
| Fees = 0, | ||
| FeesCurrency = "USDT" | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
include order details since the error handler uses .ToString() on the ExchangeOrderResults and without details it is useless. Also token["error_response"]["error"] seems insufficient in many cases so including token["error_response"]["preview_failure_reason"] as well
O-Mutt
commented
Jan 23, 2024
| payload["side"] = order.IsBuy ? BUY : "SELL"; | ||
|
|
||
| Dictionary<string, object> orderConfig = new Dictionary<string, object>(); | ||
| var amount = order.ShouldRoundAmount ? order.RoundAmount().ToStringInvariant() : order.Amount.ToStringInvariant(); |
Contributor
Author
There was a problem hiding this comment.
We check the ShouldRound and then RoundAmount if needed
Contributor
Author
There was a problem hiding this comment.
This check happens already in order.RoundAmount so i moved back to using the method instead of this variable check
thespragg
approved these changes
Jan 23, 2024
jjxtra
approved these changes
Jan 23, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.