Skip to content

Commit

Permalink
fix: Exception Handling (#141)
Browse files Browse the repository at this point in the history
Passes the actual exception (rather than relying on `sys.exc_info()` which can fail due to race conditions in multithreaded and async code.
  • Loading branch information
hydratim committed Mar 11, 2024
1 parent f9a92b6 commit afba5db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cloudquery/sdk/scheduler/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ def resolve_table(
resource = self.resolve_resource(
resolver, client, parent_item, item
)
except Exception:
except Exception as e:
self._logger.error(
"failed to resolve resource",
client_id=client.id(),
table=resolver.table.name,
depth=depth,
exc_info=True,
exc_info=e,
)
continue
res.put(SyncInsertMessage(resource.to_arrow_record()))
Expand Down Expand Up @@ -145,14 +145,14 @@ def resolve_table(
resources=total_resources,
depth=depth,
)
except Exception:
except Exception as e:
self._logger.error(
"table resolver finished with error",
client_id=client.id(),
table=resolver.table.name,
resources=total_resources,
depth=depth,
exc_info=True,
exc_info=e,
)
finally:
res.put(TableResolverFinished())
Expand Down

0 comments on commit afba5db

Please sign in to comment.