Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
7002 Zobrazení

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
dub 25
1763
1
bře 22
4384
2
kvě 21
13523
2
zář 20
3197
2
čvn 20
8265