When Insert data duplicated id, no error returned
codeskyblue opened this issue · comments
codeskyblue commented
For example:
type Author struct {
Id string
}
r.Table("authors").Insert(Author{Id: "12345"}).Exec(session)
err := r.Table("authors").Insert(Author{Id: "12345"}).Exec(session)
// expect err is not nil. but always nil actually
Jackson Sabey commented
you have to use Run or RunWrite and check the Errors field to see if there was a problem with the write
codeskyblue commented
Thanks @sabey , RunWrite
is the right way to get error. Run
still return err=nil
Jackson Sabey commented
The command was successful, the individual query however had a conflict. If you issued multiple commands it wouldn't make sense to return a generic error for all of them.