1616client_errors = (client .err .InterfaceError , client .err .DatabaseError )
1717
1818
19- def translate_query_error (client_error , query , args ):
19+ def translate_query_error (client_error , query ):
2020 """
2121 Take client error and original query and return the corresponding DataJoint exception.
2222 :param client_error: the exception raised by the client interface
2323 :param query: sql query with placeholders
24- :param args: values for query placeholders
2524 :return: an instance of the corresponding subclass of datajoint.errors.DataJointError
2625 """
2726 # Loss of connection errors
@@ -34,20 +33,20 @@ def translate_query_error(client_error, query, args):
3433 return errors .LostConnectionError (disconnect_codes [client_error .args [0 ]], * client_error .args [1 :])
3534 # Access errors
3635 if isinstance (client_error , client .err .OperationalError ) and client_error .args [0 ] in (1044 , 1142 ):
37- return errors .AccessError ('Insufficient privileges.' , * client_error .args [1 :], query )
36+ return errors .AccessError ('Insufficient privileges.' , client_error .args [1 ], query )
3837 # Integrity errors
3938 if isinstance (client_error , client .err .IntegrityError ) and client_error .args [0 ] == 1062 :
4039 return errors .DuplicateError (* client_error .args [1 :])
4140 if isinstance (client_error , client .err .IntegrityError ) and client_error .args [0 ] == 1452 :
4241 return errors .IntegrityError (* client_error .args [1 :])
4342 # Syntax Errors
4443 if isinstance (client_error , client .err .ProgrammingError ) and client_error .args [0 ] == 1064 :
45- return errors .QuerySyntaxError (* client_error .args [1 : ], query )
44+ return errors .QuerySyntaxError (client_error .args [1 ], query )
4645 # Existence Errors
4746 if isinstance (client_error , client .err .ProgrammingError ) and client_error .args [0 ] == 1146 :
48- return errors .MissingTableError (* args [1 : ], query )
47+ return errors .MissingTableError (client_error . args [1 ], query )
4948 if isinstance (client_error , client .err .InternalError ) and client_error .args [0 ] == 1364 :
50- return errors .MissingAttributeError (* args [1 :])
49+ return errors .MissingAttributeError (* client_error . args [1 :])
5150 raise client_error
5251
5352
@@ -188,7 +187,7 @@ def __execute_query(cursor, query, args, cursor_class, suppress_warnings):
188187 warnings .simplefilter ("ignore" )
189188 cursor .execute (query , args )
190189 except client_errors as err :
191- raise translate_query_error (err , query , args )
190+ raise translate_query_error (err , query )
192191
193192 def query (self , query , args = (), * , as_dict = False , suppress_warnings = True , reconnect = None ):
194193 """
@@ -284,3 +283,4 @@ def transaction(self):
284283 raise
285284 else :
286285 self .commit_transaction ()
286+
0 commit comments