Skip to content

Commit 11747d4

Browse files
authored
SWIFT-617 Remove internalDecode (#346)
1 parent b059a1b commit 11747d4

File tree

1 file changed

+0
-20
lines changed

1 file changed

+0
-20
lines changed

Sources/MongoSwift/BSON/BSONDecoder.swift

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -189,26 +189,6 @@ public class BSONDecoder {
189189
))
190190
}
191191

192-
/**
193-
* Internal version of decode that throws `.internalErrors` instead of `DecodingErrors`. Use this when using the
194-
* decoder internally on non-user-modified types.
195-
*
196-
* - Throws:
197-
* - `RuntimeError.internalError` if the BSON data is corrupt or if any value throws an error during decoding.
198-
*/
199-
internal func internalDecode<T: Decodable>(
200-
_ type: T.Type,
201-
from document: Document,
202-
withError errMsg: String = "Failed to decode \(T.self)"
203-
)
204-
throws -> T {
205-
do {
206-
return try self.decode(type, from: document)
207-
} catch is DecodingError {
208-
throw RuntimeError.internalError(message: errMsg)
209-
}
210-
}
211-
212192
/// A struct to wrap a `Decodable` type, allowing us to support decoding to types that
213193
/// are not inside a wrapping object (for ex., Int or String).
214194
private struct DecodableWrapper<T: Decodable>: Decodable {

0 commit comments

Comments
 (0)