diff --git a/influxdb_client/client/flux_csv_parser.py b/influxdb_client/client/flux_csv_parser.py index 65ba5a04..99e68094 100644 --- a/influxdb_client/client/flux_csv_parser.py +++ b/influxdb_client/client/flux_csv_parser.py @@ -1,6 +1,5 @@ """Parsing response from InfluxDB to FluxStructures or DataFrame.""" -import asyncio import base64 import codecs import csv as csv_parser @@ -147,8 +146,10 @@ async def _parse_flux_response_async(self): df = self._prepare_data_frame() if not self._is_profiler_table(metadata.table): yield df - except (asyncio.exceptions.CancelledError, asyncio.TimeoutError) as ce: - ce.add_note("Stream cancelled during read. Recommended: Check Influxdb client `timeout` setting.") + except BaseException as e: + e_type = type(e).__name__ + if "CancelledError" in e_type or "TimeoutError" in e_type: + e.add_note("Stream cancelled during read. Recommended: Check Influxdb client `timeout` setting.") raise finally: self._close()