archangelic / pinhook

the pluggable python framework for IRC bots and Twitch bots
https://archangelic.github.io/pinhook/
MIT License
31 stars 4 forks source link

correct UnboundLocalError in read_conf #76

Closed larsks closed 3 years ago

larsks commented 3 years ago

When encountering an error, read_conf uses click.echo(...) to emit an error message but then continue execution, causing the read_conf method to throw an error of the form:

UnboundLocalError: local variable 'output' referenced before assignment

By raising click.ClickException instead of calling click.echo, we ensure that pinhook exits with an error message (and no traceback).

archangelic commented 3 years ago

Thank you!! This has been irksome for a while 💖