Skip to content

Commit 241acd7

Browse files
committed
Fixed IntegrityError
1 parent 0303f1d commit 241acd7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pynuodb/exception.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def db_error_handler(error_code, error_string):
8989
raise DataError(error_code_string + ': ' + error_string)
9090
elif error_code in protocol.OPERATIONAL_ERRORS:
9191
raise OperationalError(error_code_string + ': ' + error_string)
92-
elif errorCode in protocol.INTEGRITY_ERRORS:
93-
raise IntegrityError(error_code_string + ': ' + errorString)
92+
elif error_code in protocol.INTEGRITY_ERRORS:
93+
raise IntegrityError(error_code_string + ': ' + error_String)
9494
elif error_code in protocol.INTERNAL_ERRORS:
9595
raise InternalError(error_code_string + ': ' + error_string)
9696
elif error_code in protocol.PROGRAMMING_ERRORS:

pynuodb/protocol.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@
252252
DEADLOCK,
253253
IS_SHUTDOWN}
254254

255+
INTEGRITY_ERRORS = {UNIQUE_DUPLICATE}
256+
255257
PROGRAMMING_ERRORS = {SYNTAX_ERROR,
256258
CONNECTION_ERROR,
257259
APPLICATION_ERROR,

0 commit comments

Comments
 (0)