コンテンツへスキップ
メニュー
この質問にフラグが付けられました
7203 ビュー

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?
アバター
破棄
関連投稿 返信 ビュー 活動
2
4月 25
2003
1
3月 22
4555
2
5月 21
13873
2
9月 20
3350
2
6月 20
8570