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 Jan 19, 2024
1 parent 634a2cc commit dd5c531
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 @@ -240,6 +240,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 @@ -249,7 +252,13 @@ def add_sink(
schema=schema,
key_properties=key_properties,
)
sink.setup()

try:
sink.setup()
except Exception: # pragma: no cover
self.logger.error("Error initializing '%s' target sink", self.name)
raise

self._sinks_active[stream_name] = sink
return sink

Expand Down

0 comments on commit dd5c531

Please sign in to comment.