Ir al contenido
Menú
Se marcó esta pregunta
7217 Vistas

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
Publicaciones relacionadas Respuestas Vistas Actividad
2
abr 25
2016
1
mar 22
4572
2
may 21
13889
2
sept 20
3366
2
jun 20
8595