Skip to content

Commit afba5db

Browse files
authored
fix: Exception Handling (#141)
Passes the actual exception (rather than relying on `sys.exc_info()` which can fail due to race conditions in multithreaded and async code.
1 parent f9a92b6 commit afba5db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cloudquery/sdk/scheduler/scheduler.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,13 @@ def resolve_table(
108108
resource = self.resolve_resource(
109109
resolver, client, parent_item, item
110110
)
111-
except Exception:
111+
except Exception as e:
112112
self._logger.error(
113113
"failed to resolve resource",
114114
client_id=client.id(),
115115
table=resolver.table.name,
116116
depth=depth,
117-
exc_info=True,
117+
exc_info=e,
118118
)
119119
continue
120120
res.put(SyncInsertMessage(resource.to_arrow_record()))
@@ -145,14 +145,14 @@ def resolve_table(
145145
resources=total_resources,
146146
depth=depth,
147147
)
148-
except Exception:
148+
except Exception as e:
149149
self._logger.error(
150150
"table resolver finished with error",
151151
client_id=client.id(),
152152
table=resolver.table.name,
153153
resources=total_resources,
154154
depth=depth,
155-
exc_info=True,
155+
exc_info=e,
156156
)
157157
finally:
158158
res.put(TableResolverFinished())

0 commit comments

Comments
 (0)