From e93e03f2ae4761e5872b2d7729dd725c0421bb7b Mon Sep 17 00:00:00 2001 From: Mahmoud Hashemi Date: Sat, 11 Jun 2016 16:07:34 -0700 Subject: [PATCH] tbutils: add get_formatted_exception_only method --- boltons/tbutils.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/boltons/tbutils.py b/boltons/tbutils.py index 17bcfc2..54b4397 100644 --- a/boltons/tbutils.py +++ b/boltons/tbutils.py @@ -409,6 +409,9 @@ class ExceptionInfo(object): tb_str = self.tb_info.get_formatted() return ''.join([tb_str, '%s: %s' % (self.exc_type, self.exc_msg)]) + def get_formatted_exception_only(self): + return '%s: %s' % (self.exc_type, self.exc_msg) + class ContextualCallpoint(Callpoint): """The ContextualCallpoint is a :class:`Callpoint` subtype with the