Skip to content

add asyncio debug handler #295

@ajmirsky

Description

@ajmirsky

when a client tries to connect the broker but it is refused due to certificate error, there is no message on the broker side. turn this exception into a logger

import asyncio

def custom_exception_handler(loop, context):
    print("🚨 Asyncio error:", context["message"])
    if "exception" in context:
        print("Exception:", context["exception"])

loop = asyncio.get_event_loop()
loop.set_exception_handler(custom_exception_handler)


asyncio.get_event_loop().set_debug(True)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions