Set proper verbose level for dbms direct error messages

This commit is contained in:
Bernardo Damele 2010-11-07 22:14:06 +00:00
parent a96467b3e2
commit 27ce4b0cf0
8 changed files with 16 additions and 16 deletions

View File

@ -53,14 +53,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except pyodbc.ProgrammingError, msg: except pyodbc.ProgrammingError, msg:
logger.log(8, msg[1]) logger.warn(msg[1])
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(query) self.cursor.execute(query)
except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg: except (pyodbc.OperationalError, pyodbc.ProgrammingError), msg:
logger.log(8, msg[1]) logger.warn(msg[1])
except pyodbc.Error, msg: except pyodbc.Error, msg:
raise sqlmapConnectionException, msg[1] raise sqlmapConnectionException, msg[1]

View File

@ -50,14 +50,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except kinterbasdb.OperationalError, msg: except kinterbasdb.OperationalError, msg:
logger.log(8, msg[1]) logger.warn(msg[1])
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(query) self.cursor.execute(query)
except kinterbasdb.OperationalError, msg: except kinterbasdb.OperationalError, msg:
logger.log(8, msg[1]) logger.warn(msg[1])
except kinterbasdb.Error, msg: except kinterbasdb.Error, msg:
raise sqlmapConnectionException, msg[1] raise sqlmapConnectionException, msg[1]

View File

@ -52,14 +52,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg: except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg:
logger.log(8, msg) logger.warn(msg)
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(utf8encode(query)) self.cursor.execute(utf8encode(query))
except (pymssql.OperationalError, pymssql.ProgrammingError), msg: except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
logger.log(8, msg) logger.warn(msg)
except pymssql.InternalError, msg: except pymssql.InternalError, msg:
raise sqlmapConnectionException, msg raise sqlmapConnectionException, msg

View File

@ -47,14 +47,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except MySQLdb.ProgrammingError, msg: except MySQLdb.ProgrammingError, msg:
logger.log(8, msg[1]) logger.warn(msg[1])
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(query) self.cursor.execute(query)
except (MySQLdb.OperationalError, MySQLdb.ProgrammingError), msg: except (MySQLdb.OperationalError, MySQLdb.ProgrammingError), msg:
logger.log(8, msg[1]) logger.warn(msg[1])
except MySQLdb.InternalError, msg: except MySQLdb.InternalError, msg:
raise sqlmapConnectionException, msg[1] raise sqlmapConnectionException, msg[1]

View File

@ -56,14 +56,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except cx_Oracle.InterfaceError, msg: except cx_Oracle.InterfaceError, msg:
logger.log(8, msg) logger.warn(msg)
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(utf8encode(query)) self.cursor.execute(utf8encode(query))
except (cx_Oracle.DatabaseError), msg: except (cx_Oracle.DatabaseError), msg:
logger.log(8, msg) logger.warn(msg)
except cx_Oracle.InternalError, msg: except cx_Oracle.InternalError, msg:
raise sqlmapConnectionException, msg raise sqlmapConnectionException, msg

View File

@ -51,14 +51,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except psycopg2.ProgrammingError, msg: except psycopg2.ProgrammingError, msg:
logger.log(8, msg) logger.warn(msg)
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(query) self.cursor.execute(query)
except (psycopg2.OperationalError, psycopg2.ProgrammingError), msg: except (psycopg2.OperationalError, psycopg2.ProgrammingError), msg:
logger.log(8, msg) logger.warn(msg)
except psycopg2.InternalError, msg: except psycopg2.InternalError, msg:
raise sqlmapConnectionException, msg raise sqlmapConnectionException, msg

View File

@ -68,14 +68,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except self.__sqlite.OperationalError, msg: except self.__sqlite.OperationalError, msg:
logger.log(8, msg[0]) logger.warn(msg[0])
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(utf8encode(query)) self.cursor.execute(utf8encode(query))
except self.__sqlite.OperationalError, msg: except self.__sqlite.OperationalError, msg:
logger.log(8, msg[0]) logger.warn(msg[0])
except self.__sqlite.DatabaseError, msg: except self.__sqlite.DatabaseError, msg:
raise sqlmapConnectionException, msg[0] raise sqlmapConnectionException, msg[0]

View File

@ -52,14 +52,14 @@ class Connector(GenericConnector):
try: try:
return self.cursor.fetchall() return self.cursor.fetchall()
except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg: except (pymssql.ProgrammingError, pymssql.OperationalError, _mssql.MssqlDatabaseException), msg:
logger.log(8, msg) logger.warn(msg)
return None return None
def execute(self, query): def execute(self, query):
try: try:
self.cursor.execute(utf8encode(query)) self.cursor.execute(utf8encode(query))
except (pymssql.OperationalError, pymssql.ProgrammingError), msg: except (pymssql.OperationalError, pymssql.ProgrammingError), msg:
logger.log(8, msg) logger.warn(msg)
except pymssql.InternalError, msg: except pymssql.InternalError, msg:
raise sqlmapConnectionException, msg raise sqlmapConnectionException, msg