thinky
thinky copied to clipboard
removeRelation does not throw DocumentNotFound
When you use removeRelation on a non-existant model, the user thrown is ReqlUserError but not a DocumentNotFound.
{ [ReqlUserError: The query did not find a document and returned null in:
r.table("Group").get("00000000-0000-1000-8000-000000000000").default(r.error("The query did not find a document and returned null."))("id").do(function(var_1338) {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
return r.table("Group_User").getAll(var_1338.add("_").add("00000000-0000-1000-8000-000000000000"))
.delete()
})
]
[stack]: [Getter/Setter],
message: 'The query did not find a document and returned null in:\nr.table("Group").get("00000000-0000-1000-8000-000000000000").default(r.error("The query did not find a document and returned null."))("id").do(function(var_1338) {\n ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ \n return r.table("Group_User").getAll(var_1338.add("_").add("00000000-0000-1000-8000-000000000000"))\n .delete()\n})\n',
frames: [ 1, 0, 1, [length]: 3 ],
name: 'ReqlUserError' }
@neumino ?
Yea, I think we just need to wrap errors in case a post validation is required