advice on error handling (coinbasepro improvement)
See original GitHub issuecoinbasepro currently throws an ExchangeError
when cancelling an already cancelled order. I think it would be improved if it throw an OrderNotFound
error (as I believe some other implementations do).
@kroitor - do you have any advice, or do you have a good example on how to implement this properly? The response has a 400 status code and a body with an error message:
fetch:
coinbasepro DELETE https://api.pro.coinbase.com/orders/528725347
Request:
{ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36',
'CB-ACCESS-KEY': '403b4cd50cc52d8320bc711d26888bac',
'CB-ACCESS-SIGN': 'vgpVFDBtWl9JXW72plnEZw4DiS3T+Um3n1nDsaS/tC4=',
'CB-ACCESS-TIMESTAMP': '1551003406',
'CB-ACCESS-PASSPHRASE': 'hlacrixe8ul',
'Content-Type': 'application/json' }
undefined
handleRestResponse:
coinbasepro DELETE https://api.pro.coinbase.com/orders/528725347 400 Bad Request
Response:
{ Date: 'Sun, 24 Feb 2019 10:16:46 GMT',
'Content-Type': 'application/json; charset=utf-8',
'Content-Length': '30',
Connection: 'close',
'Set-Cookie': '__cfduid=da2aa34ae78f5ee1eaef1fbdb02915d9d1551003406; expires=Mon, 24-Feb-20 10:16:46 GMT; path=/; domain=.pro.coinbase.com; HttpOnly',
'Access-Control-Allow-Headers': 'Content-Type, Accept, cb-session, cb-fp',
'Access-Control-Allow-Methods': 'GET,POST,DELETE,PUT',
'Access-Control-Allow-Origin': '*',
'Access-Control-Expose-Headers': 'cb-before, cb-after, cb-gdpr',
'Access-Control-Max-Age': '7200',
'Cache-Control': 'no-store',
Etag: 'W/"1e-jtBpYXwiagh6JcjFc50t32rmn/s"',
'Strict-Transport-Security': 'max-age=15552000; includeSubDomains',
'X-Content-Type-Options': 'nosniff',
'X-Dns-Prefetch-Control': 'off',
'X-Download-Options': 'noopen',
'X-Frame-Options': 'SAMEORIGIN',
'X-Xss-Protection': '1; mode=block',
'Expect-Ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
Server: 'cloudflare',
'Cf-Ray': '4ae12db8fb9e6b9d-LHR' }
{"message":"Invalid order id"}
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (5 by maintainers)
Top Results From Across the Web
Hello Advanced Trade, goodbye Coinbase Pro - Blog
Advanced Trade offers more in-depth technical analysis, advanced real-time order books, and charting powered by TradingView to help customers research and ...
Read more >Coinbase Support (@CoinbaseSupport) / Twitter
We're experiencing degraded performance for http://Coinbase.com, Prime, Custody, and Exchange. Our teams are working to resolve this as soon as possible and ...
Read more >Coinbase slammed for terrible customer service after hackers ...
Experts say SIM swapping, where fraudsters seize control of a victim's phone number and SIM card through their phone company, is to blame...
Read more >Coinbase down? Current outages and problems. | Downdetector
Select the option you are having issues with, and help provide feedback to the service. I have a problem with Coinbase ...
Read more >Coinbase-pro for Node.js - Websocket connection breaking ...
it does break from time to time for no apparent reason. All you can do is listen for the heartbeat messages and use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Understood. Thanks
Ignore this. Found it.
Question is though, what should the exception be? OrderNotFound or InvalidOrderId