Permalink
Browse files

exceptions message

  • Loading branch information...
1 parent 2f87adf commit ce56b0106131b26ea5fc82f48ecd553637aa56f8 @sr committed Oct 8, 2008
Showing with 4 additions and 3 deletions.
  1. +4 −3 lib/couchy/database.rb
View
@@ -98,13 +98,14 @@ def bulk_save(docs)
def delete(document, revision=nil)
case document
when String
- raise ArgumentError unless revision
+ raise ArgumentError, 'Document revision must be specified' unless revision
server.delete "#{name}/#{CGI.escape(document)}", :rev => revision
when Hash
- raise ArgumentError unless document['_id'] && document['_rev']
+ raise ArgumentError, 'Document ID and revision must be specified' unless
+ document['_id'] && document['_rev']
server.delete("#{name}/#{CGI.escape(document['_id'])}", :rev => document['_rev'])
else
- raise ArgumentError
+ raise ArgumentError, 'Document must be an Hash representing the document or its ID'
end
end

0 comments on commit ce56b01

Please sign in to comment.