From 1f53ff0633a618c96cd6de3f2bb1c911cfa6b229 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Fri, 13 Jan 2012 15:56:50 +0000 Subject: [PATCH] minor update regarding last commit --- lib/core/threads.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/lib/core/threads.py b/lib/core/threads.py index 34008087a..8979565fa 100644 --- a/lib/core/threads.py +++ b/lib/core/threads.py @@ -19,9 +19,8 @@ from lib.core.data import kb from lib.core.data import logger from lib.core.datatype import AttribDict from lib.core.enums import PAYLOAD -from lib.core.exception import sqlmapConnectionException +from lib.core.exception import exceptionsTuple from lib.core.exception import sqlmapThreadException -from lib.core.exception import sqlmapValueException from lib.core.settings import MAX_NUMBER_OF_THREADS from lib.core.settings import PYVERSION @@ -168,11 +167,20 @@ def runThreads(numThreads, threadFunction, cleanupFunction=None, forwardExceptio if forwardException: raise - except Exception, errMsg: + except exceptionsTuple, errMsg: print kb.threadException = True logger.error("thread %s: '%s'" % (threading.currentThread().getName(), errMsg)) + except: + from lib.core.common import unhandledExceptionMessage + + print + kb.threadException = True + errMsg = unhandledExceptionMessage() + logger.error("thread %s: '%s'" % (threading.currentThread().getName(), errMsg)) + traceback.print_exc() + finally: kb.multiThreadMode = False kb.bruteMode = False