Skip to content

Commit

Permalink
fix serialization issue with non-json values
Browse files Browse the repository at this point in the history
  • Loading branch information
TelegramXPlus authored Sep 8, 2024
1 parent a808543 commit a689fb1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion microrabbit/app/rabbit_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ async def _handler(self, exchange: Exchange, function: Callable[..., Awaitable],
await message.ack()

body = message.body.decode()
data = ast.literal_eval(body)
try:
data = ast.literal_eval(body)
except SyntaxError:
data = body

_logger.debug(f"Received message {data} from {message.routing_key}")

Expand Down

0 comments on commit a689fb1

Please sign in to comment.