Skip to Content
Menú
This question has been flagged
7287 Vistes

Hi guys,

Here is my code

try:
     raise UserError(_('foo'))
except Exception as e:
     raise UserError(_(str(e)))

The warning box shows (u'foo', None) instead of foo.

Warning
    (u'foo', None)

[OK]

But exception shows correctly

Example

try:
     print 100 / 0
     raise UserError(_('foo'))
except Exception as e:
     raise UserError(_(str(e)))

Result is

Warning
integer division or modulo by zero
[OK]  
This Problem is only inside the try.
Please tell me what can I do?
Avatar
Descartar
Related Posts Respostes Vistes Activitat
2
d’abr. 25
2062
1
de març 22
4626
2
de maig 21
13962
2
de set. 20
3419
2
de juny 20
8665