##// END OF EJS Templates
ui: add support for fully printing chained exception stacks in ui.traceback()...
Matt Harbison -
r18965:0062508b default
parent child Browse files
Show More
@@ -686,11 +686,23 b' class ui(object):'
686 686 only to call in exception handler. returns true if traceback
687 687 printed.'''
688 688 if self.tracebackflag:
689 if exc:
689 if exc is None:
690 exc = sys.exc_info()
691 cause = getattr(exc[1], 'cause', None)
692
693 if cause is not None:
694 causetb = traceback.format_tb(cause[2])
695 exctb = traceback.format_tb(exc[2])
696 exconly = traceback.format_exception_only(cause[0], cause[1])
697
698 # exclude frame where 'exc' was chained and rethrown from exctb
699 self.write_err('Traceback (most recent call last):\n',
700 ''.join(exctb[:-1]),
701 ''.join(causetb),
702 ''.join(exconly))
703 else:
690 704 traceback.print_exception(exc[0], exc[1], exc[2],
691 705 file=self.ferr)
692 else:
693 traceback.print_exc(file=self.ferr)
694 706 return self.tracebackflag
695 707
696 708 def geteditor(self):
@@ -771,6 +771,11 b' Create repo without default path, pull t'
771 771 abort: default path for subrepository not found (in subrepo sub/repo) (glob)
772 772 [255]
773 773
774 Ensure a full traceback, not just the SubrepoAbort part
775
776 $ hg -R issue1852b update --traceback 2>&1 | grep 'raise util\.Abort'
777 raise util.Abort(_("default path for subrepository not found"))
778
774 779 Pull -u now doesn't help
775 780
776 781 $ hg -R issue1852b pull -u issue1852a
General Comments 0
You need to be logged in to leave comments. Login now