diff --git a/taskweaver/misc/component_registry.py b/taskweaver/misc/component_registry.py index 7a9bd27a..0d1aab1a 100644 --- a/taskweaver/misc/component_registry.py +++ b/taskweaver/misc/component_registry.py @@ -61,7 +61,7 @@ def registry(self) -> Dict[str, component_type]: return self.get_registry() def get_list(self, force_reload: bool = False, freshness: Optional[timedelta] = None) -> List[component_type]: - registry = self.get_registry(force_reload, freshness) + registry = self.get_registry(force_reload, freshness, show_error=True) keys = sorted(registry.keys()) return [registry[k] for k in keys] diff --git a/taskweaver/role/translator.py b/taskweaver/role/translator.py index 59751db7..53e27d41 100644 --- a/taskweaver/role/translator.py +++ b/taskweaver/role/translator.py @@ -59,8 +59,12 @@ def raw_text_to_post( ], f"Invalid send_to value: {value}" post.send_to = value # type: ignore else: - type = AttachmentType(type_str) - post.add_attachment(Attachment.create(type=type, content=value)) + try: + type = AttachmentType(type_str) + post.add_attachment(Attachment.create(type=type, content=value)) + except Exception as e: + self.logger.warning(f"Failed to parse attachment: {d} due to {str(e)}") + continue event_handler(type_str, value) parsed_type = ( type