From 339062f01f84944e82d09ca67f7dc331a5970e72 Mon Sep 17 00:00:00 2001 From: Felix Scheinost <31761492+felixscheinost@users.noreply.github.com> Date: Wed, 2 Dec 2020 10:08:55 +0100 Subject: [PATCH] Fix try-catch blocks in documentation --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 06f43356b..238e69df8 100644 --- a/README.md +++ b/README.md @@ -7326,7 +7326,7 @@ The `asyncRead` method can be used from any thread. It submits your database sta ```swift reader.asyncRead { (dbResult: Result) 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) in - try { + do { let db = try dbResult.get() // Guaranteed to be zero let count = try Player.fetchCount(db)