From 922dbb828629e1c628f3136158ca2b546be7c10b Mon Sep 17 00:00:00 2001 From: Damien Voreiter Date: Thu, 8 Sep 2022 15:09:31 +0200 Subject: [PATCH] raise CouchbaseOrm::Error --- lib/couchbase-orm/connection.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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