Minor fix

This commit is contained in:
Miroslav Stampar 2013-10-15 09:49:27 +02:00
parent 344d3f4b5f
commit d7906e8f18

View File

@ -69,14 +69,14 @@ class SQLAlchemy(GenericConnector):
retVal.append(tuple(row)) retVal.append(tuple(row))
return retVal return retVal
except _sqlalchemy.exc.ProgrammingError, msg: except _sqlalchemy.exc.ProgrammingError, msg:
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1]) logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg.message if hasattr(msg, "message") else msg)
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor = self.connector.execute(query) self.cursor = self.connector.execute(query)
except (_sqlalchemy.exc.OperationalError, _sqlalchemy.exc.ProgrammingError), msg: except (_sqlalchemy.exc.OperationalError, _sqlalchemy.exc.ProgrammingError), msg:
logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg[1]) logger.log(logging.WARN if conf.dbmsHandler else logging.DEBUG, "(remote) %s" % msg.message if hasattr(msg, "message") else msg)
except _sqlalchemy.exc.InternalError, msg: except _sqlalchemy.exc.InternalError, msg:
raise SqlmapConnectionException(msg[1]) raise SqlmapConnectionException(msg[1])