chore: catch wrong keywords better

This commit is contained in:
2026-01-02 15:54:04 +01:00
parent a652ea99d3
commit cd10645056
2 changed files with 22 additions and 18 deletions

View File

@@ -259,18 +259,22 @@ async def main():
Console.print_text(args.silent, "Writing to file...")
history.write_history(formatted_history)
await session.close()
except OSError as message:
Console.print_text(args.silent,
Console.text_color.red + f'{message}')
Console.print_text(
args.silent,
Console.text_color.red + f'{message}'
)
except asyncio.CancelledError:
Console.print_text(args.silent,
Console.text_color.red + "Received SIGINT, Aborting - (Tasks may still be running on targets).")
await session.close()
Console.print_text(
args.silent,
Console.text_color.red + "Received SIGINT, Aborting - (Tasks may still be running on targets)."
)
raise
finally:
await session.close()
if __name__ == "__main__":
try:
asyncio.run(main())