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

More graceful device monitor error messages #4362

Closed
1 task done
maxgerhardt opened this issue Jul 17, 2022 · 1 comment
Closed
1 task done

More graceful device monitor error messages #4362

maxgerhardt opened this issue Jul 17, 2022 · 1 comment

Comments

@maxgerhardt
Copy link
Contributor

maxgerhardt commented Jul 17, 2022

What kind of issue is this?

  • PlatformIO Core.
    If you’ve found a bug, please provide an information below.

You can erase any parts of this template not applicable to your Issue.


Configuration

Operating system: Win 10 x64

PlatformIO Version (platformio --version): 6.1.1rc1

Description of problem

When invoking pio device monitor -f <filter name> with a non-existing filter name, a long stacktrace is shown instead of a better error message.

Steps to Reproduce

  1. Execute pio device monitor -f abc in the CLI

Actual Results

>pio device monitor -f abc
Error: Traceback (most recent call last):
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\__main__.py", line 102, in main
    cli()  # pylint: disable=no-value-for-parameter
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\cli.py", line 71, in invoke
    return super().invoke(ctx)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\device\monitor\command.py", line 139, in device_monitor_cmd
    start_terminal(options)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\device\monitor\terminal.py", line 50, in start_terminal
    term = new_terminal(options)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\device\monitor\terminal.py", line 98, in new_terminal
    term = Terminal(
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\platformio\device\monitor\terminal.py", line 28, in __init__
    super().__init__(*args, **kwargs)
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\serial\tools\miniterm.py", line 403, in __init__
    self.update_transformations()
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\serial\tools\miniterm.py", line 454, in update_transformations
    transformations = [EOL_TRANSFORMATIONS[self.eol]] + [TRANSFORMATIONS[f]
  File "c:\users\max\appdata\local\programs\python\python38\lib\site-packages\serial\tools\miniterm.py", line 454, in <listcomp>
    transformations = [EOL_TRANSFORMATIONS[self.eol]] + [TRANSFORMATIONS[f]
KeyError: 'abc'

============================================================

An unexpected error occurred. Further steps:

* Verify that you have the latest version of PlatformIO using
  `pip install -U platformio` command

* Try to find answer in FAQ Troubleshooting section
  https://docs.platformio.org/page/faq/index.html

* Report this problem to the developers
  https://github.com/platformio/platformio-core/issues

============================================================

Expected Results

More gracefull error message saying "filter does not exist, please choose from: ..."

If problems with PlatformIO Build System:

-/-

Additional info

Pyserial is of the latest version.

>python -m pip install -U pyserial
Requirement already satisfied: pyserial in c:\users\max\appdata\local\programs\python\python38\lib\site-packages (3.5)
@ivankravets ivankravets added this to the 6.1.2 milestone Jul 17, 2022
@maxgerhardt maxgerhardt changed the title More gracefull device monitor error messages More graceful device monitor error messages Jul 18, 2022
@ivankravets
Copy link
Member

Thanks for the report! 🙏

PIO Core 6.1.2 is out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants