RethinkDB error codes on inserting duplicate primary key -


what best way handle error thrown when row existing primary key being inserted.

rethinkdb returns 'duplicate primary key...' in first_error.

currently how handling it:

        if result['errors'] > 0 , 'duplicate primary key' in result['first_error']: 

but seems brittle, rethinkdb return error codes along error string messages.

the driver don't return specific error codes, think code have best way go. keep in mind these messages sent directly server (not driver), if change, have change @ database level.

if feel getting error codes useful, i'd suggest creating issue in rethinkdb's github issue tracker. in rethinkdb team usually, @ least, acknowledge issue , see if can include in database.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -