@@ -72,15 +72,15 @@ internal protocol BSONValue: Codable {
7272 * - Throws:
7373 * - `InternalError` if the `DocumentStorage` would exceed the maximum size by encoding this
7474 * key-value pair.
75- * - `LogicError` if the value is an `Array` and it contains a non-`BSONValue` element.
75+ * - `MongoError. LogicError` if the value is an `Array` and it contains a non-`BSONValue` element.
7676 */
7777 func encode( to document: inout BSONDocument , forKey key: String ) throws
7878
7979 /**
8080 * Given a `BSONDocumentIterator` known to have a next value of this type,
8181 * initializes the value.
8282 *
83- * - Throws: `LogicError` if the current type of the `BSONDocumentIterator` does not correspond to the
83+ * - Throws: `MongoError. LogicError` if the current type of the `BSONDocumentIterator` does not correspond to the
8484 * associated type of this `BSONValue`.
8585 */
8686 static func from( iterator iter: BSONDocumentIterator ) throws -> BSON
@@ -259,7 +259,7 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
259259
260260 /// Initializes a `BSONBinary` instance from a `UUID`.
261261 /// - Throws:
262- /// - `InvalidArgumentError` if a `BSONBinary` cannot be constructed from this UUID.
262+ /// - `MongoError. InvalidArgumentError` if a `BSONBinary` cannot be constructed from this UUID.
263263 public init ( from uuid: UUID ) throws {
264264 let uuidt = uuid. uuid
265265
@@ -275,7 +275,7 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
275275
276276 /// Initializes a `BSONBinary` instance from a `Data` object and a `UInt8` subtype.
277277 /// - Throws:
278- /// - `InvalidArgumentError` if the provided data is incompatible with the specified subtype.
278+ /// - `MongoError. InvalidArgumentError` if the provided data is incompatible with the specified subtype.
279279 public init ( data: Data , subtype: Subtype ) throws {
280280 if [ Subtype . uuid, Subtype . uuidDeprecated] . contains ( subtype) && data. count != 16 {
281281 throw MongoError . InvalidArgumentError (
@@ -291,7 +291,7 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
291291
292292 /// Initializes a `BSONBinary` instance from a base64 `String` and a `Subtype`.
293293 /// - Throws:
294- /// - `InvalidArgumentError` if the base64 `String` is invalid or if the provided data is
294+ /// - `MongoError. InvalidArgumentError` if the base64 `String` is invalid or if the provided data is
295295 /// incompatible with the specified subtype.
296296 public init ( base64: String , subtype: Subtype ) throws {
297297 guard let dataObj = Data ( base64Encoded: base64) else {
@@ -315,7 +315,7 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
315315 let subtype = bson_subtype_t ( UInt32 ( self . subtype. rawValue) )
316316 let length = self . data. writerIndex
317317 guard let byteArray = self . data. getBytes ( at: 0 , length: length) else {
318- throw InternalError ( message: " Cannot read \( length) bytes from Binary.data " )
318+ throw MongoError . InternalError ( message: " Cannot read \( length) bytes from Binary.data " )
319319 }
320320 try document. withMutableBSONPointer { docPtr in
321321 guard bson_append_binary ( docPtr, key, Int32 ( key. utf8. count) , subtype, byteArray, UInt32 ( length) ) else {
@@ -351,7 +351,7 @@ public struct BSONBinary: BSONValue, Equatable, Codable, Hashable {
351351
352352 /// Converts this `BSONBinary` instance to a `UUID`.
353353 /// - Throws:
354- /// - `InvalidArgumentError` if a non-UUID subtype is set on this `BSONBinary`.
354+ /// - `MongoError. InvalidArgumentError` if a non-UUID subtype is set on this `BSONBinary`.
355355 public func toUUID( ) throws -> UUID {
356356 guard [ Subtype . uuid, Subtype . uuidDeprecated] . contains ( self . subtype) else {
357357 throw MongoError . InvalidArgumentError (
@@ -554,7 +554,7 @@ public struct BSONDecimal128: BSONValue, Equatable, Codable, CustomStringConvert
554554 /// Returns the provided string as a `bson_decimal128_t`, or throws an error if initialization fails due an
555555 /// invalid string.
556556 /// - Throws:
557- /// - `InvalidArgumentError` if the parameter string does not correspond to a valid `BSONDecimal128`.
557+ /// - `MongoError. InvalidArgumentError` if the parameter string does not correspond to a valid `BSONDecimal128`.
558558 internal static func toLibBSONType( _ str: String ) throws -> bson_decimal128_t {
559559 var value = bson_decimal128_t ( )
560560 guard bson_decimal128_from_string ( str, & value) else {
0 commit comments