Skip to content

Commit

Permalink
Fix generic exception to see traceback
Browse files Browse the repository at this point in the history
  • Loading branch information
anxodio committed Oct 1, 2024
1 parent 9d0df0e commit cfe6950
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions som_indexada/wizard/wizard_change_to_indexada.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions som_polissa/exceptions/exceptions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
import traceback
from osv import osv
from tools.translate import _

Expand All @@ -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
Expand Down

0 comments on commit cfe6950

Please sign in to comment.