Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
7025 Переглядів

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?
Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
2
квіт. 25
1785
1
бер. 22
4406
2
трав. 21
13581
2
вер. 20
3234
2
черв. 20
8312