Handle Exceptions from modules
This commit is contained in:
parent
c00ef3df9f
commit
db4bd80a94
12
inni/cli.py
12
inni/cli.py
|
@ -74,10 +74,14 @@ def _login_out(ctx: click.Context, login: bool):
|
||||||
console.print(f"\n[green bold]Logging {'In' if login else 'Out'}\n")
|
console.print(f"\n[green bold]Logging {'In' if login else 'Out'}\n")
|
||||||
for name, module in modules.items():
|
for name, module in modules.items():
|
||||||
console.rule(f"[bold cyan]Module: {name}", align="left")
|
console.rule(f"[bold cyan]Module: {name}", align="left")
|
||||||
if login:
|
try:
|
||||||
module.login(responses)
|
if login:
|
||||||
else:
|
module.login(responses)
|
||||||
module.logout(responses)
|
else:
|
||||||
|
module.logout(responses)
|
||||||
|
except Exception:
|
||||||
|
error_console.print(f"[red bold]Fatal error occured running module {name}")
|
||||||
|
error_console.print_exception()
|
||||||
|
|
||||||
|
|
||||||
@inni.command()
|
@inni.command()
|
||||||
|
|
Loading…
Reference in New Issue