Closed ha07z7xe closed 5 years ago
Yes, just need to slightly extend BitmexApiProxy.cs so that we can wrap such errors into special exception-classes so then you can catch and handle this on your consumer side
@alex-lucid @HA07Z7XE Hi both, you would like to have different exception type for these codes, wouldn't you?
Hi @semashkinvg , actually I have propagated the StatusCode itself through BitmexApiException
so that my consuming code can handle and retry - https://github.com/semashkinvg/Bitmex.NET/pull/36 , https://github.com/HA07Z7XE/Bitmex.NET/commit/b722abcd58e8a3ae6e28d223f66f5a94a6929d39
(Sorry, I did not fix my PR because I do not have a net462 environment).
My preference would be the same approach, as then other StatusCodes can also be handled from the client should the need arise.
@HA07Z7XE ok, let me have a look how it could be approached
@HA07Z7XE have a look at the commit attached to this issue, would it be sufficient in your case?
@semashkinvg not 100%. If possible I would like to fix my PR which has the same changes. If I fix the CI build, does my PR look ok?
There are a few related (albiet breaking) changes in there around returning rate limit data which I also require,
@HA07Z7XE wow! you PR is just amazing, I dreamed to implement it half of year ago, but didn't have time to do this. Please proceed, that's absolutely great!
@HA07Z7XE please run Integration tests with your own account (Api Key and secret) but don't commit them
Sure. I'll get something up soon.
Bitmex returns the following errors in response to overload and rate limit caps respectively: https://www.bitmex.com/app/restAPI
Is there a way to propagate this information to the application, so it can handle them appropriately?