Skip to content
This repository was archived by the owner on Aug 21, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/bson/bson_error.cr
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,4 +12,4 @@ class BSON
super("Domain: #{@domain}, code: #{@code}, #{@detail}")
end
end
end
end
2 changes: 1 addition & 1 deletion src/mongo/read_prefs.cr
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down