diff options
author | Alejandro Sirgo Rica <asirgo@soleta.eu> | 2024-03-18 09:36:55 +0100 |
---|---|---|
committer | lupoDharkael <izhe@hotmail.es> | 2024-03-21 10:29:57 +0100 |
commit | 0cbf16461e05bc5f15d3436763667b1d34869826 (patch) | |
tree | 117371efe019e9f3d88b45917253fc04fec989ff /ogclient | |
parent | 80125623027283c9a9d94a98bea442b1f0c11206 (diff) |
ogclient: consolidate logging in client core
The main function must be able to handle the login of critical
error in the main ogClient class instance. Add a try except block
to the ogCLient run logic and move the relevant error logs into
the except block.
Delegate the error messages to the exception message. This is the
first step towards error message deduplication.
Diffstat (limited to 'ogclient')
-rwxr-xr-x | ogclient | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -88,9 +88,12 @@ def main(): if args.debug: logging.getLogger().setLevel('DEBUG') - client = ogClient(config=CONFIG) - client.connect() - client.run() + try: + client = ogClient(config=CONFIG) + client.connect() + client.run() + except Exception as e: + logging.critical(e) if __name__ == "__main__": main() |