From 810f9b3fdfb729b23e77de13497f711b1e78d15e Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Sat, 16 Mar 2019 14:01:30 +0100 Subject: Add more debug messages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …to controller and behavior --- crocoite/cli.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'crocoite/cli.py') diff --git a/crocoite/cli.py b/crocoite/cli.py index 1f22c45..0595eb9 100644 --- a/crocoite/cli.py +++ b/crocoite/cli.py @@ -23,6 +23,7 @@ Command line interface """ import argparse, sys, signal, asyncio, os +from traceback import TracebackException from enum import IntEnum from yarl import URL try: @@ -86,6 +87,14 @@ def single (): ret = SingleExitStatus.Ok except Crashed: ret = SingleExitStatus.BrowserCrash + except asyncio.CancelledError: + # don’t log this one + pass + except Exception as e: + ret = SingleExitStatus.Fail + logger.error ('cli exception', + uuid='7fd69858-ecaa-4225-b213-8ab880aa3cc5', + traceback=list (TracebackException.from_exception (e).format ())) finally: r = handler[0].stats logger.info ('stats', context='cli', uuid='24d92d16-770e-4088-b769-4020e127a7ff', **r) -- cgit v1.2.3