diff --git a/lib/couchbase-orm/connection.rb b/lib/couchbase-orm/connection.rb index c959393e..a50e4c4b 100644 --- a/lib/couchbase-orm/connection.rb +++ b/lib/couchbase-orm/connection.rb @@ -4,7 +4,7 @@ module CouchbaseOrm class Connection def self.config - @@config || raise('Missing CouchbaseOrm connection config') + @@config || raise(CouchbaseOrm::Error, 'Missing CouchbaseOrm connection config') end def self.config=(config) @@ -14,18 +14,18 @@ def self.config=(config) def self.cluster @cluster ||= begin cb_config = Couchbase::Configuration.new - cb_config.connection_string = config[:connection_string] || raise('Missing CouchbaseOrm connection string') - cb_config.username = config[:username] || raise('Missing CouchbaseOrm username') - cb_config.password = config[:password] || raise('Missing CouchbaseOrm password') + cb_config.connection_string = config[:connection_string] || raise(CouchbaseOrm::Error, 'Missing CouchbaseOrm connection string') + cb_config.username = config[:username] || raise(CouchbaseOrm::Error, 'Missing CouchbaseOrm username') + cb_config.password = config[:password] || raise(CouchbaseOrm::Error, 'Missing CouchbaseOrm password') Couchbase::Cluster.connect(cb_config) end end def self.bucket @bucket ||= begin - bucket_name = config[:bucket] || raise('Missing CouchbaseOrm bucket name') - cluster.bucket(bucket_name) - end + bucket_name = config[:bucket] || raise(CouchbaseOrm::Error, 'Missing CouchbaseOrm bucket name') + cluster.bucket(bucket_name) + end end end end \ No newline at end of file