alpacahq / alpaca-py

The Official Python SDK for Alpaca API
https://alpaca.markets/sdks/python/getting_started.html
Apache License 2.0
561 stars 137 forks source link

APIError should make message more readily available to end users #431

Open kwilsonmg opened 6 months ago

kwilsonmg commented 6 months ago

Is there an existing issue for this?

Is your feature request related to a problem? Please describe.

Currently you can access the APIError's code but not the message that is also returned with it. This seems to have been an oversight.

Describe the solution you'd like.

A new property called "message" that returns the message, just like how the code is returned by the "code" property.

Describe an alternate solution.

N/A

Anything else? (Additional Context)

No response

kwilsonmg commented 6 months ago

Once this is merged, it makes solving #136 slightly easier as well...or at least fewer lines of code.