diff --git a/src/bson/bson_error.cr b/src/bson/bson_error.cr index f769750..ad6d1ba 100644 --- a/src/bson/bson_error.cr +++ b/src/bson/bson_error.cr @@ -1,6 +1,9 @@ class BSON class BSONError < Exception getter domain, code, detail + @domain : UInt32 + @code : UInt32 + @detail : String def initialize(bson_error) @domain = bson_error.value.domain @@ -9,4 +12,4 @@ class BSON super("Domain: #{@domain}, code: #{@code}, #{@detail}") end end -end \ No newline at end of file +end diff --git a/src/mongo/read_prefs.cr b/src/mongo/read_prefs.cr index fdbf6c6..96a0375 100644 --- a/src/mongo/read_prefs.cr +++ b/src/mongo/read_prefs.cr @@ -3,7 +3,7 @@ class Mongo::ReadPrefs raise "invalid handle" unless @handle end - def initialize(mode = LibMongoC::ReadMode::PRIMARY : LibMongoC::ReadMode) + def initialize(mode : LibMongoC::ReadMode::PRIMARY = LibMongoC::ReadMode) initialize LibMongoC.read_prefs_new(mode) end