Skip to content

Commit

Permalink
rescue request failed
Browse files Browse the repository at this point in the history
  • Loading branch information
paulca committed Feb 24, 2009
1 parent 1534cb8 commit a2d926b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/stuffing.rb
Expand Up @@ -90,8 +90,12 @@ def create_stuffing
end

def update_stuffing
record = couchdb_content.merge({'_id' => couchdb_id, '_rev' => couchdb_content['_rev']})
couchdb.save(record)
begin
record = couchdb_content.merge({'_id' => couchdb_id, '_rev' => couchdb_content['_rev']})
couchdb.save(record)
rescue RestClient::RequestFailed
couchdb.save(couchdb_content)
end
get_stuffing
end

Expand Down

0 comments on commit a2d926b

Please sign in to comment.