Skip to content

Nested exception: "During handling of the above exception, another exception occurred" #248

Closed
@dglaude

Description

@dglaude

I have a project where a PyPortal read from MQTT and display status.

Traceback (most recent call last):
  File "adafruit_minimqtt/adafruit_minimqtt.py", line 1036, in _wait_for_msg
  File "adafruit_minimqtt/adafruit_minimqtt.py", line 1124, in _sock_exact_recv
  File "adafruit_esp32spi/adafruit_esp32spi_socketpool.py", line 171, in recv_into
  File "adafruit_esp32spi/adafruit_esp32spi_socketpool.py", line 198, in _available
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 892, in socket_available
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 431, in _send_command_get_response
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 398, in _wait_response_cmd
  File "adafruit_esp32spi/adafruit_esp32spi.py", line 377, in _wait_spi_char
TimeoutError: Timed out waiting for SPI char

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "code.py", line 247, in <module>
  File "adafruit_minimqtt/adafruit_minimqtt.py", line 1011, in loop
  File "adafruit_minimqtt/adafruit_minimqtt.py", line 1041, in _wait_for_msg
TypeError: function takes 3 positional arguments but 2 were given
]0;🐍1041@adafruit_minimqtt/adafruit_minim TypeError | 9.2.7\
Code done running.

My code seems to not responsible for this error:

while True:
    try:
        mqtt_client.loop(timeout=1)  # Poll the message queue <= Line 247
    except (ValueError, RuntimeError, MQTT.MMQTTException) as e:
        print("Failed to get data, retrying.")
        text_area[0].text = "Failed to get data, retrying."
        mqtt_client.reconnect()  # continue

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