Bug 810742 - Handle callee thrown exceptions when invoking a mach command; r=jhammel

This commit is contained in:
Gregory Szorc 2012-12-05 14:21:58 -08:00
parent e401276626
commit 3966850da2

View File

@ -314,6 +314,18 @@ To see more help for a specific command, run:
# The first frame is us and is never used.
stack = traceback.extract_tb(exc_tb)[1:]
# If we have nothing on the stack, the exception was raised as part
# of calling the @Command method itself. This likely means a
# mismatch between @CommandArgument and arguments to the method.
# e.g. there exists a @CommandArgument without the corresponding
# argument on the method. We handle that here until the module
# loader grows the ability to validate better.
if not len(stack):
print(COMMAND_ERROR)
self._print_exception(sys.stdout, exc_type, exc_value,
traceback.extract_tb(exc_tb))
return 1
# Split the frames into those from the module containing the
# command and everything else.
command_frames = []