@@ -70,7 +70,7 @@ internal protocol BSONValue: Codable {
7070 * - key: A `String`, the key under which to store the value.
7171 *
7272 * - Throws:
73- * - `InternalError` if the `DocumentStorage` would exceed the maximum size by encoding this
73+ * - `MongoError. InternalError` if the `DocumentStorage` would exceed the maximum size by encoding this
7474 * key-value pair.
7575 * - `MongoError.LogicError` if the value is an `Array` and it contains a non-`BSONValue` element.
7676 */
@@ -240,18 +240,18 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
240240
241241 /// Initializes a `Subtype` with a custom value. This value must be in the range 0x80-0xFF.
242242 /// - Throws:
243- /// - `InvalidArgumentError` if value passed is outside of the range 0x80-0xFF
243+ /// - `MongoError. InvalidArgumentError` if value passed is outside of the range 0x80-0xFF
244244 public static func userDefined( _ value: Int ) throws -> Subtype {
245245 guard let byteValue = UInt8 ( exactly: value) else {
246- throw InvalidArgumentError ( message: " Cannot represent \( value) as UInt8 " )
246+ throw MongoError . InvalidArgumentError ( message: " Cannot represent \( value) as UInt8 " )
247247 }
248248 guard byteValue >= 0x80 else {
249- throw InvalidArgumentError (
249+ throw MongoError . InvalidArgumentError (
250250 message: " userDefined value must be greater than or equal to 0x80 got \( byteValue) "
251251 )
252252 }
253253 guard let subtype = Subtype ( rawValue: byteValue) else {
254- throw InvalidArgumentError ( message: " Cannot represent \( byteValue) as Subtype " )
254+ throw MongoError . InvalidArgumentError ( message: " Cannot represent \( byteValue) as Subtype " )
255255 }
256256 return subtype
257257 }
@@ -360,7 +360,7 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
360360 }
361361
362362 guard let data = self . data. getBytes ( at: 0 , length: 16 ) else {
363- throw InternalError ( message: " Unable to read 16 bytes from Binary.data " )
363+ throw MongoError . InternalError ( message: " Unable to read 16 bytes from Binary.data " )
364364 }
365365
366366 let uuid : uuid_t = (
@@ -524,7 +524,7 @@ public struct BSONDecimal128: BSONValue, Equatable, Codable, CustomStringConvert
524524 * - a BSONDecimal128 number as a string.
525525 *
526526 * - Throws:
527- * - A `InvalidArgumentError` if the string does not represent a BSONDecimal128 encodable value.
527+ * - A `MongoError. InvalidArgumentError` if the string does not represent a BSONDecimal128 encodable value.
528528 *
529529 * - SeeAlso: https://github.com/mongodb/specifications/blob/master/source/bson-decimal128/decimal128.rst
530530 */
@@ -862,11 +862,11 @@ public struct BSONObjectID: BSONValue, Equatable, CustomStringConvertible, Codab
862862
863863 /// Initializes an `BSONObjectID` from the provided hex `String`.
864864 /// - Throws:
865- /// - `InvalidArgumentError` if string passed is not a valid BSONObjectID
865+ /// - `MongoError. InvalidArgumentError` if string passed is not a valid BSONObjectID
866866 /// - SeeAlso: https://github.com/mongodb/specifications/blob/master/source/objectid.rst
867867 public init ( _ hex: String ) throws {
868868 guard bson_oid_is_valid ( hex, hex. utf8. count) else {
869- throw InvalidArgumentError ( message: " Cannot create ObjectId from \( hex) " )
869+ throw MongoError . InvalidArgumentError ( message: " Cannot create ObjectId from \( hex) " )
870870 }
871871 var oid_t = bson_oid_t ( )
872872 bson_oid_init_from_string ( & oid_t, hex)
0 commit comments