crate / crate-python

Python DB API client library for CrateDB, using HTTP.
https://cratedb.com/docs/python/
Apache License 2.0
79 stars 31 forks source link

Add `error_trace` to string representation of an Error #648

Closed seut closed 1 month ago

seut commented 1 month ago

If the error_trace payload is available, add it to the string representation of the Error class.

This way, any layer using the driver, e.g. our SqlAlchemy Dialect, can display the error trace without to handle concrete exceptions. Additionally, handling the concrete exception and reading the self.error_trace variable won't be always possible (e.g. in generic SqlAlchemy abstractions). If the error_trace is available is already depending on the concrete connect(error_trace=True) attribute and thus in control of the user.

amotl commented 1 month ago

That other patch validates the improvement on the downstream SQLAlchemy dialect.