From 196e2d35b2649a1df176910db746c69a5aa630ed Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Tue, 1 Feb 2011 11:06:56 +0000 Subject: [PATCH] maybe we could ask user "are you willing to import local data content into error report" and use this function respectably --- lib/core/common.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/core/common.py b/lib/core/common.py index 3e778fe8e..5c1ea126f 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -2279,6 +2279,10 @@ def decodeIntToUnicode(value): return INFERENCE_UNKNOWN_CHAR def unhandledExceptionMessage(): + """ + Returns detailed message about occured unhandled exception + """ + errMsg = "unhandled exception in %s, retry your " % VERSION_STRING errMsg += "run with the latest development version from the Subversion " errMsg += "repository. If the exception persists, please send by e-mail " @@ -2310,3 +2314,17 @@ def listToStrValue(value): retValue = value return retValue + +def getExceptionFrameLocals(): + """ + Returns dictionary with local variable content from frame + where exception was raised + """ + + retVal = {} + if sys.exc_info(): + trace = sys.exc_info()[2] + while trace.tb_next: + trace = trace.tb_next + retVal = trace.tb_frame.f_locals + return retVal