def render_to_blocks(self, template: Template, context: Dict[str, Any]) -> List[Dict[str, Any]]:
        """
        Render a Jinja2 Template object using the provided context and parse the result as JSON to get Slack blocks.
        Args:
            template: A Jinja2 Template object
            context: Dictionary of variables to pass to the template
        Returns:
            List of Slack block objects (dictionaries)
        """
        try:
            rendered = template.render(**context)
            blocks = []
            for block_str in rendered.strip().split("\n\n"):
                if not block_str.strip():
                    continue
                try:
                    # Try to parse as JSON, but if it fails, log and skip
                    block = json.loads(block_str)
                    blocks.append(block)
                except json.JSONDecodeError as e:
                    logging.exception(f"Error parsing JSON from template output: {e}")
                    logging.warning(f"Problematic JSON (repr): {repr(block_str)}")
                    continue  # Skip this block and continue
                except Exception as e:
                    logging.error(f"Unexpected error parsing block: {e}")
                    logging.warning(f"Problematic JSON (repr): {repr(block_str)}")
                    continue
            return blocks
        except Exception as e:
            logging.error(f"Error rendering template: {e}")
            return []

        Render a Jinja2 Template object using the provided context and parse the result as JSON to get Slack blocks.
        Args:
            template: A Jinja2 Template object
            context: Dictionary of variables to pass to the template
        Returns:
            List of Slack block objects (dictionaries)
        
src/robusta/core/sinks/slack/templates/template_loader.py