Closed watzon closed 2 years ago
The rethinkdb library doesn't have very good errors, but this is a bit of a separate fail. What you have here is either a validation error or DB persistence error.
I agree, the exception in its current form is not very helpful.
An immediate improvement to this error would be raising a new error in case of an invalid document, RethinkORM::Error::InvalidDocument
, and rendering the validations in the error body.
I'll attempt to improve the quality of the alternate error cases as well when I have bandwidth
Got a PR for what I mentioned above.
Unfortunately, the response back from the rethinkDB driver are really limited - essentially just an object with counts of inserted
, updated
, replaced
, unchanged
I'll look into if it's possible to improve errors via the driver
Idk if this applies to this repo so much as kingsleyh/crystal-rethinkdb, but I feel like better error messages are a must. Right now errors look like this:
which gives little to no useful information. It would be nice to know why the query failed, and not just that it did.