Close the given cursor, catching exceptions and turning into log warnings.
(self, cursor: DBAPICursor)
| 2217 | ) |
| 2218 | |
| 2219 | def _safe_close_cursor(self, cursor: DBAPICursor) -> None: |
| 2220 | """Close the given cursor, catching exceptions |
| 2221 | and turning into log warnings. |
| 2222 | |
| 2223 | """ |
| 2224 | try: |
| 2225 | cursor.close() |
| 2226 | except Exception: |
| 2227 | # log the error through the connection pool's logger. |
| 2228 | self.engine.pool.logger.error( |
| 2229 | "Error closing cursor", exc_info=True |
| 2230 | ) |
| 2231 | |
| 2232 | _reentrant_error = False |
| 2233 | _is_disconnect = False |
no test coverage detected