You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently calling doc.update_doc(<id>) with an ID that does not exist throws the wrong exception.
NoMethodError:
undefined method `[]=' for nil:NilClass
# ./lib/couchrest/database.rb:254:in `update_doc'
Previous versions of CouchRest threw this exception:
RestClient::ResourceNotFound:` 404 Resource Not Found: {"error":"not_found","reason":"missing"}
Now that #get returns nil, it just carries on and passes nil to the block and then nil to save_doc.
I am not sure if the best solution is to raise an exception such as something like CouchRest:NotFound or pass in a new hash instantiated with the id ie {'_id' => <id>} or something else.
I sort of like instantiating, which I think would be sort of like an upsert.
The text was updated successfully, but these errors were encountered:
Currently calling
doc.update_doc(<id>)
with an ID that does not exist throws the wrong exception.Previous versions of CouchRest threw this exception:
Now that
#get
returns nil, it just carries on and passesnil
to the block and thennil
tosave_doc
.I am not sure if the best solution is to raise an exception such as something like
CouchRest:NotFound
or pass in a new hash instantiated with the id ie{'_id' => <id>}
or something else.I sort of like instantiating, which I think would be sort of like an upsert.
The text was updated successfully, but these errors were encountered: