Answer the question
In order to leave comments, you need to log in
How to catch error in psycopg2 request?
There is a code:
def removeEmail(email):
try:
print(email)
sql = """DELETE FROM "НеправильнаяТаблица" WHERE email = '[email protected]'"""
cur.execute(sql)
return successResponse
except psycopg2.Error as e:
logging.exception(e.pgerror)
return failResponse
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question