biothings / biothings.api

BioThings API framework - Making high-performance API for biological annotation data
https://biothings.io
Apache License 2.0
45 stars 25 forks source link

Refactor ES exceptions #346

Closed everaldorodrigo closed 2 months ago

everaldorodrigo commented 3 months ago

Context

The application should raise an exception when there is a timeout connection when connecting to the Elasticsearch.

However, there is an error in the exception handling function:

AttributeError: 'ConnectionTimeout' object has no attribute 'error'

There bug is in this line: https://github.com/biothings/biothings.api/blob/8a430d25c8f31e7d43c74317887cee5feab32fd6/biothings/web/query/pipeline.py#L134

Solution

Refactor the exception handling function.