fix exception handling in command system

This commit is contained in:
Yann Leboulanger 2009-11-01 13:50:34 +01:00
parent a75fba495b
commit ea973ddc2e
2 changed files with 2 additions and 1 deletions

View File

@ -158,7 +158,7 @@ class Command(object):
# in case if they was not set by the one who raised an exception. # in case if they was not set by the one who raised an exception.
except CommandError, error: except CommandError, error:
if not error.command and not error.name: if not error.command and not error.name:
raise CommandError(exception.message, self) raise CommandError(error.message, self)
raise raise
# This one is a little bit too wide, but as Python does not have # This one is a little bit too wide, but as Python does not have

View File

@ -22,6 +22,7 @@ from common import gajim
from common import helpers from common import helpers
from common.exceptions import GajimGeneralException from common.exceptions import GajimGeneralException
from ..errors import CommandError
from ..framework import CommandContainer, command, documentation from ..framework import CommandContainer, command, documentation
from ..mapping import generate_usage from ..mapping import generate_usage