Close the given cursor, catching exceptions and turning into log warnings.
(self, cursor: DBAPICursor)
| 2183 | ) |
| 2184 | |
| 2185 | def _safe_close_cursor(self, cursor: DBAPICursor) -> None: |
| 2186 | """Close the given cursor, catching exceptions |
| 2187 | and turning into log warnings. |
| 2188 | |
| 2189 | """ |
| 2190 | try: |
| 2191 | cursor.close() |
| 2192 | except Exception: |
| 2193 | # log the error through the connection pool's logger. |
| 2194 | self.engine.pool.logger.error( |
| 2195 | "Error closing cursor", exc_info=True |
| 2196 | ) |
| 2197 | |
| 2198 | _reentrant_error = False |
| 2199 | _is_disconnect = False |
no test coverage detected