kannibalox / pyrosimple

An overhauled fork of the pyrocore tools for rTorrent
https://kannibalox.github.io/pyrosimple/
GNU General Public License v3.0
48 stars 5 forks source link

No error message produced by rtcontrol when querying for unknown field. #48

Closed govardha closed 1 year ago

govardha commented 1 year ago

Hello,

I just noticed this issue in your fork of rtcontrol.

When I issued this command in the OG version of pyrocore's tools

rtcontrol name=Blah -o random_unknown_field
ERROR    Unknown field name 'random_unknown_field'

When I run this in pyrosimple, I get this.

rtcontrol name=Blah -o random_unknown_field
Traceback (most recent call last):
  File "/home/foobar/.venv/lib/python3.11/site-packages/pyrosimple/scripts/base.py", line 181, in run
    self.mainloop()
  File "/home/foobar/.venv/lib/python3.11/site-packages/pyrosimple/scripts/rtcontrol.py", line 774, in mainloop
    self.validate_output_format(default_output_format)
  File "/home/foobar/.venv/lib/python3.11/site-packages/pyrosimple/scripts/rtcontrol.py", line 624, in validate_output_format
    for field in rtorrent.validate_field_list(
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/foobar/.venv/lib/python3.11/site-packages/pyrosimple/torrent/rtorrent.py", line 975, in validate_field_list
    raise error.UserError(f"Unknown field name {name!r}")
pyrosimple.error.UserError: Unknown field name 'random_unkown_field'

Did I not install pyrosimple properly?

Thank you!

kannibalox commented 1 year ago

Is it causing you any specific problems, or more just surprise that it behaves differently? It's a fatal error message either way, but I intentionally allow that exception to bubble up, because catching all pyrosimple.error.UserErrors and logging them as just errors can make debugging some of the more uncommon problems harder.

govardha commented 1 year ago

Hello kannibalox,

It was more surprise that this bubbled up when I was trying some stuff out. But I get your thought process on letting this be. I will close this issue.

I am looking forward to integrating the pimp-my-box workflow with your tools now. Your toolkit is awesome and I am so glad you ported this to python3.

Thank you! g