Skip to content

Commit

Permalink
fix(targets): Log sink when an unhandled error occurs during setup
Browse files Browse the repository at this point in the history
  • Loading branch information
edgarrmondragon committed Dec 21, 2023
1 parent 4001522 commit 34f77ed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion singer_sdk/target_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,9 @@ def add_sink(
Returns:
A new sink for the stream.
Raises:
Exception: If sink setup fails.
"""
self.logger.info("Initializing '%s' target sink...", self.name)
sink_class = self.get_sink_class(stream_name=stream_name)
Expand All @@ -248,7 +251,13 @@ def add_sink(
schema=schema,
key_properties=key_properties,
)
sink.setup()

try:
sink.setup()
except Exception:
self.logger.exception("Error initializing '%s' target sink", self.name)
raise

Check warning on line 259 in singer_sdk/target_base.py

View check run for this annotation

Codecov / codecov/patch

singer_sdk/target_base.py#L257-L259

Added lines #L257 - L259 were not covered by tests

self._sinks_active[stream_name] = sink
return sink

Expand Down

0 comments on commit 34f77ed

Please sign in to comment.