File tree Expand file tree Collapse file tree 7 files changed +18
-6
lines changed
VaporExample/Sources/VaporExample Expand file tree Collapse file tree 7 files changed +18
-6
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import PackageDescription
33
44let package = Package (
55 name: " BugReport " ,
6+ platforms: [
7+ . macOS( . v10_14)
8+ ] ,
69 dependencies: [
710 . package ( url: " https://github.com/mongodb/mongo-swift-driver " , . upToNextMajor( from: " 1.0.0-rc0 " ) )
811 ] ,
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import PackageDescription
33
44let package = Package (
55 name: " DocsExamples " ,
6+ platforms: [
7+ . macOS( . v10_14)
8+ ] ,
69 dependencies: [
710 . package ( url: " https://github.com/mongodb/mongo-swift-driver " , . branch( " master " ) ) ,
811 . package ( url: " https://github.com/apple/swift-nio " , . upToNextMajor( from: " 2.0.0 " ) )
Original file line number Diff line number Diff line change @@ -188,7 +188,7 @@ private func transactions() throws {
188188 let eventLoop = txnFuture. eventLoop
189189 return txnFuture. flatMapError { error in
190190 guard
191- let labeledError = error as? LabeledError ,
191+ let labeledError = error as? MongoLabeledError ,
192192 labeledError. errorLabels? . contains ( " TransientTransactionError " ) == true
193193 else {
194194 return eventLoop. makeFailedFuture ( error)
@@ -205,7 +205,7 @@ private func transactions() throws {
205205 let eventLoop = commitFuture. eventLoop
206206 return commitFuture. flatMapError { error in
207207 guard
208- let labeledError = error as? LabeledError ,
208+ let labeledError = error as? MongoLabeledError ,
209209 labeledError. errorLabels? . contains ( " UnknownTransactionCommitResult " ) == true
210210 else {
211211 print ( " Error during commit... " )
Original file line number Diff line number Diff line change @@ -119,7 +119,7 @@ private func transactions() throws {
119119 } catch {
120120 print ( " Transaction aborted. Caught exception during transaction. " )
121121 guard
122- let labeledError = error as? LabeledError ,
122+ let labeledError = error as? MongoLabeledError ,
123123 labeledError. errorLabels? . contains ( " TransientTransactionError " ) == true
124124 else {
125125 throw error
@@ -141,7 +141,7 @@ private func transactions() throws {
141141 break
142142 } catch {
143143 guard
144- let labeledError = error as? LabeledError ,
144+ let labeledError = error as? MongoLabeledError ,
145145 labeledError. errorLabels? . contains ( " UnknownTransactionCommitResult " ) == true
146146 else {
147147 print ( " Error during commit ... " )
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import PackageDescription
33
44let package = Package (
55 name: " KituraExample " ,
6+ platforms: [
7+ . macOS( . v10_14)
8+ ] ,
69 dependencies: [
710 . package ( url: " https://github.com/IBM-Swift/Kitura " , . upToNextMajor( from: " 2.9.1 " ) ) ,
811 . package ( url: " https://github.com/mongodb/mongo-swift-driver " , . upToNextMajor( from: " 1.0.0 " ) ) ,
Original file line number Diff line number Diff line change @@ -3,6 +3,9 @@ import PackageDescription
33
44let package = Package (
55 name: " PerfectExample " ,
6+ platforms: [
7+ . macOS( . v10_14)
8+ ] ,
69 dependencies: [
710 . package ( url: " https://github.com/PerfectlySoft/Perfect-HTTPServer.git " , from: " 3.0.0 " ) ,
811 . package ( url: " https://github.com/mongodb/mongo-swift-driver " , . upToNextMajor( from: " 1.0.0 " ) ) ,
Original file line number Diff line number Diff line change @@ -12,9 +12,9 @@ func routes(_ app: Application) throws {
1212 /// `Kitten` from the collection. `MongoCollection` is safe to share across threads.
1313 let collection = app. mongoClient. db ( " home " ) . collection ( " kittens " , withType: Kitten . self)
1414
15- app. get ( " kittens " ) { _ -> EventLoopFuture < [ Kitten ] > in
15+ app. get ( " kittens " ) { req -> EventLoopFuture < [ Kitten ] > in
1616 collection. find ( ) . flatMap { cursor in
1717 cursor. toArray ( )
18- }
18+ } . hop ( to : req . eventLoop )
1919 }
2020}
You can’t perform that action at this time.
0 commit comments