Fix try-catch blocks in documentation

This commit is contained in:
Felix Scheinost authored and GitHub committed 2020-12-02 10:08:55 +01:00
1 parent 2a917823ed
commit 339062f01f
1 file changed
+3 -3
+3 -3
View File
@@ -7326,7 +7326,7 @@ The `asyncRead` method can be used from any thread. It submits your database sta
```swift
reader.asyncRead { (dbResult: Result<Database, Error>) in
try {
do {
let db = try dbResult.get()
let players = try Player.fetchAll(db)
} catch {
@@ -7390,7 +7390,7 @@ The `asyncWriteWithoutTransaction` method can be used from any thread. It submit
```swift
writer.asyncWriteWithoutTransaction { (db: Database) in
try {
do {
try Player(...).insert(db)
} catch {
// handle error
@@ -7424,7 +7424,7 @@ try writer.asyncWriteWithoutTransaction { db in
// <- not in a transaction here
// Count players concurrently
writer.asyncConcurrentRead { (dbResult: Result<Database, Error>) in
try {
do {
let db = try dbResult.get()
// Guaranteed to be zero
let count = try Player.fetchCount(db)