Ostico / PhpOrient

PhpOrient - Official Php driver based on the binary protocol of OrientDB.
Other
68 stars 37 forks source link

Handling insert / update error #18

Closed bankorh closed 3 years ago

bankorh commented 9 years ago

Hi.

Recently I faced some issues of inserting / updating a unique key. I created an index and set it to unique. Whenever I try to insert the duplicated key, I got the exception error.

I would like to ask, is it possible to get something like status code that representing the error like "key is existing"?

Ostico commented 9 years ago

Hi @bankorh ,

at the moment there are not a map of error codes, basically because OrientDB at moment does not pass codes but only exceptions. Surely i can try to add a map of error codes, but they would be totally arbitrary, and if you will rely on them, when OrientDB will implement it's own codes there will be a mismatch. Before implement that solution i must discuss with OrientDb Team.

bankorh commented 9 years ago

Hi, @Ostico ,

thank you for your reply and your contribution for this. Looking for better solutions from you. Have a nice day.