Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICOn Rename: Handle Timeout #59

Closed
sanssecours opened this issue Jun 27, 2024 · 0 comments
Closed

ICOn Rename: Handle Timeout #59

sanssecours opened this issue Jun 27, 2024 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@sanssecours
Copy link
Member

Description

The command icon rename does not exit cleanly, if you try to rename a sensor device which is not available.

Steps to Reproduce

Try to rename a sensor device that is not available

icon rename -d 1000 Test-STH

Expected Result

The tool exits showing an error message, e.g. something like

TimeoutError: Unable to find sensor device with device_number “1000” in 20 seconds

Found the following sensor devices:
🤖 Name: CGvXAd6B, Device Number: 0, MAC address: 08-6B-D7-01-DE-81, RSSI: -39

Actual Result

The command prints a stack trace:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Rene\AppData\Local\Programs\Python\Python312\Scripts\icon.exe\__main__.py", line 7, in <module>
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\scripts\icon.py", line 376, in main
    run(command_to_coroutine[arguments.subcommand](arguments))
  File "C:\Users\Rene\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\Rene\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rene\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\scripts\icon.py", line 294, in rename
    await network.connect_sensor_device(identifier)
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\can\network.py", line 1819, in connect_sensor_device
    raise TimeoutError(
TimeoutError: Unable to find sensor device with device_number “1000” in 20 seconds

Found the following sensor devices:
🤖 Name: CGvXAd6B, Device Number: 0, MAC address: 08-6B-D7-01-DE-81, RSSI: -39
@sanssecours sanssecours added the bug Something isn't working label Jun 27, 2024
@sanssecours sanssecours added this to the 1.12.0 milestone Jun 27, 2024
@sanssecours sanssecours self-assigned this Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant