alpaca-trade-api
alpaca-trade-api copied to clipboard
Raise 400 responses as an InvalidRequest
If there is a malformed request, in my case it was passing an array of strings for the "symbols" parameter, the client will return an Order with all nil parameters, instead of rightfully raising an error when it wasn't fulfilled.
This adds checking for 400 errors in various places within the client and raises an InvalidRequest with the error message.