Skip to content

ICOc: Improve Error Message About Streaming Timeout #69

@sanssecours

Description

@sanssecours

Description

The error message for streaming timeout from the sensor device should be improved.

Steps to Reproduce the Problem

  1. Enter the following command (for a device called “Test-STH”) in a Windows (PowerShell) prompt:

    icoc -n 'Test-STH' -r 10
    
  2. Wait for the measurement window for to pop up

  3. Disconnect the device before the measurement time (10 seconds) elapses

Expected Result

A helpful error message tells the user that no measurement data was received in the last seconds. Maybe something like this:

Exiting program since no measurement data was received in the last 4.05 seconds

Actual Result

  • The error message includes the stack trace, which is not helpful for a standard user.
  • The term „streaming“ might also not be that helpful for a typical user.
  • The text about too many retries should maybe be less emphasized (by the unhappy smiley)
Exiting program since no streaming data was received in the last 4.05 seconds
Error
—————
☹️ Too many retries (2)

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\icoc.exe\__main__.py", line 7, in <module>
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\ui.py", line 833, in main
    raise error
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\ui.py", line 829, in main
    UserInterface().run()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\ui.py", line 810, in run
    self.vRunConsoleAutoConnect()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 1103, in vRunConsoleAutoConnect
    self.vDataAquisition()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 862, in vDataAquisition
    self.vGetStreamingAccData()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 1009, in vGetStreamingAccData
    self.vGetStreamingAccDataProcess()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 947, in vGetStreamingAccDataProcess
    self.__exit__()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 158, in __exit__
    self._BlueToothStatistics()
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 346, in _BlueToothStatistics
    log_statistics("STH1", "sensor node")
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\cli.py", line 328, in log_statistics
    send_counter = self.Can.BlueToothCmd(
                   ^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\network.py", line 1759, in BlueToothCmd
    ack = self.tWriteFrameWaitAckRetries(message, retries=2)["Payload"][2:]
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\network.py", line 637, in tWriteFrameWaitAckRetries
    self.__exitError(f"Too many retries ({retries})")
  File "C:\Users\Rene\Documents\Projects\ICOc\mytoolit\old\network.py", line 238, in __exitError
    raise Exception(sErrorMessage)
Exception: Too many retries (2)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions