From 47eae4a2b3f2276e9f58dd809ca57c0dea553bad Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Wed, 26 Nov 2025 14:40:05 +0000 Subject: [PATCH] Fix formatting error --- trustgraph-cli/trustgraph/cli/dump_queues.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/trustgraph-cli/trustgraph/cli/dump_queues.py b/trustgraph-cli/trustgraph/cli/dump_queues.py index 2cbe8c21..580ef016 100644 --- a/trustgraph-cli/trustgraph/cli/dump_queues.py +++ b/trustgraph-cli/trustgraph/cli/dump_queues.py @@ -24,7 +24,13 @@ def format_message(queue_name, msg): # Try to parse as JSON and pretty-print try: - value = msg.value() + # Handle both Message objects and raw bytes + if hasattr(msg, 'value'): + # Message object with .value() method + value = msg.value() + else: + # Raw bytes from schema-less subscription + value = msg # If it's bytes, decode it if isinstance(value, bytes): @@ -51,7 +57,7 @@ def format_message(queue_name, msg): body = str(value) except Exception as e: - body = f"\n{msg.value()}" + body = f"\n{str(msg)}" # Format the output header = f"\n{'='*80}\n[{timestamp}] Queue: {queue_name}\n{'='*80}\n"