This is an automated email from the ASF dual-hosted git repository.

sebb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git


The following commit(s) were added to refs/heads/master by this push:
     new cab6a1d  Add some context for error messages
cab6a1d is described below

commit cab6a1d0979d4c4ee900412fb8f61c702a52b093
Author: Sebb <s...@apache.org>
AuthorDate: Tue Apr 30 11:31:36 2024 +0100

    Add some context for error messages
---
 tools/archiver.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/archiver.py b/tools/archiver.py
index 96e831a..f924374 100755
--- a/tools/archiver.py
+++ b/tools/archiver.py
@@ -430,7 +430,7 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
                 ):
                     first_html = Body(part)
             except Exception as err:
-                print(err)
+                print('Error on line 
{}:'.format(sys.exc_info()[-1].tb_lineno), type(err).__name__, err)
 
         # this requires a GPL lib, user will have to install it themselves
         if first_html and (
@@ -761,7 +761,7 @@ class Archiver(object):  # N.B. Also used by import-mbox.py
         # If we have a dump dir and ES failed, push to dump dir instead as a 
JSON object
         # We'll leave it to another process to pick up the slack.
         except Exception as err:
-            print(err)
+            print('Error on line {}:'.format(sys.exc_info()[-1].tb_lineno), 
type(err).__name__, err)
             if dump:
                 print(
                     "Pushing to ES failed, but dumponfail specified, dumping 
JSON docs"

Reply via email to