php-rql icon indicating copy to clipboard operation
php-rql copied to clipboard

Support new RethinkDB 2.1 error type hierarchy

Open danielmewes opened this issue 10 years ago • 6 comments

danielmewes avatar Sep 27 '15 16:09 danielmewes

It seems that errors in js is to exceptions in php. Would you call them errors or exceptions?

mbrevda avatar Sep 30 '15 08:09 mbrevda

What I meant is just implementing an analogue of this https://github.com/rethinkdb/rethinkdb/issues/4559 . Currently we have the exception types RqlDriverError and RqlServerError. We should implement subclasses of these corresponding to the error types reported by RethinkDB 2.1.

danielmewes avatar Oct 07 '15 01:10 danielmewes

(in all of the official RethinkDB drivers including the JS one each error type corresponds to one exception class)

danielmewes avatar Oct 07 '15 01:10 danielmewes

I saw that. I was asking if they shouldn't be renamed in php from "Errors" to "Exceptions"?

mbrevda avatar Oct 07 '15 02:10 mbrevda

Ah, got you.

I think it would be better to stay close to the official exception names (so people can look at http://rethinkdb.com/docs/error-types/ and immediately understand what the corresponding exception in PHP-RQL is).

I originally picked slightly different exception names from the official drivers when I first wrote PHP-RQL a few years ago, but wouldn't to the same again. It just increases the documentation work and makes the driver more confusing for users who have been reading the official documentation.

danielmewes avatar Oct 13 '15 22:10 danielmewes

This makes sense

mbrevda avatar Oct 14 '15 10:10 mbrevda