diff --git a/som_indexada/wizard/wizard_change_to_indexada.py b/som_indexada/wizard/wizard_change_to_indexada.py index 5231a06fe..8deb15ffd 100644 --- a/som_indexada/wizard/wizard_change_to_indexada.py +++ b/som_indexada/wizard/wizard_change_to_indexada.py @@ -292,9 +292,9 @@ def change_to_indexada(self, cursor, uid, ids, context=None): wiz.action_crear_contracte() if not coeficient_k: self.send_indexada_modcon_created_email(cursor, uid, polissa) - except Exception as e: + except Exception: polissa.send_signal("undo_modcontractual") - raise exceptions.UnexpectedException(e) + raise exceptions.UnexpectedException() wizard.write({"state": "end"}) return polissa.modcontractuals_ids[0].id diff --git a/som_polissa/exceptions/exceptions.py b/som_polissa/exceptions/exceptions.py index ba60d784f..09cec8114 100644 --- a/som_polissa/exceptions/exceptions.py +++ b/som_polissa/exceptions/exceptions.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import traceback from osv import osv from tools.translate import _ @@ -22,10 +23,10 @@ def to_dict(self): class UnexpectedException(SomPolissaException): - def __init__(self, e): + def __init__(self): super(UnexpectedException, self).__init__( title=_("Unexpected exception"), - text=repr(e) + text=traceback.format_exc() ) @property