Skip to content

Commit

Permalink
Improve stream discovery error handling in TapKlaviyo
Browse files Browse the repository at this point in the history
This commit enhances the discover_streams method in the TapKlaviyo class by adding error handling during the stream discovery process. Instead of failing silently, the method now logs an error message if an exception occurs while instantiating a stream class. This change improves the robustness of the integration by ensuring that issues with specific streams are reported, facilitating easier debugging and maintenance.
  • Loading branch information
butkeraites-hotglue committed Dec 2, 2024
1 parent 771930e commit 9419efe
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tap_klaviyo/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ def __init__(

def discover_streams(self) -> List[Stream]:
"""Return a list of discovered streams."""
return [stream_class(tap=self) for stream_class in STREAM_TYPES]
discovered_streams = []
for stream_class in STREAM_TYPES:
try:
stream = stream_class(tap=self)
discovered_streams.append(stream)
except Exception as e:
self.logger.error(f"Error discovering stream {stream_class}: {e}")
return discovered_streams


if __name__ == "__main__":
Expand Down

0 comments on commit 9419efe

Please sign in to comment.