diff --git a/singer_sdk/target_base.py b/singer_sdk/target_base.py index 7a80d71e05..baf020f4bd 100644 --- a/singer_sdk/target_base.py +++ b/singer_sdk/target_base.py @@ -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) @@ -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.exception("Error initializing '%s' target sink", self.name) + raise + self._sinks_active[stream_name] = sink return sink