Skip to content

Commit 6e91188

Browse files
committed
Add missing 'try' statements to macOS example.
1 parent 27b294f commit 6e91188

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Example/NotesExample-macOS/AppDelegate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,20 @@ class AppDelegate: NSObject, NSApplicationDelegate {
3434
try noteBox.put(georgeMartin.writeNote(title: "Game of Thrones", text: "This book title would've been a better choice than this Ice & Fire stuff all along. Boy, writing this takes long in DOS."))
3535

3636
logger.append("Reading all notes:")
37-
logger.append("\(noteBox.all().readableDescription)\n")
37+
logger.append("\(try noteBox.all().readableDescription)\n")
3838

3939
logger.append("Reading notes containing 'writing':")
40-
let allWritingNotes = noteBox.query { Note.text.contains("writing") }.build().all()
40+
let allWritingNotes = try noteBox.query { Note.text.contains("writing") }.build().all()
4141
logger.append("\(allWritingNotes.readableDescription)\n")
4242

4343
logger.append("Reading notes containing 'writing' by Peter Brett:")
44-
let peterBrettsWritingNotes = noteBox.query { Note.text.contains("writing") && Note.author == peterBrett.id }.build().all()
44+
let peterBrettsWritingNotes = try noteBox.query { Note.text.contains("writing") && Note.author.isEqual(to: peterBrett.id) }.build().all()
4545
logger.append("\(peterBrettsWritingNotes.readableDescription)\n")
4646

4747
logger.append("Looking into Peter Brett's current object state again ...")
4848
logger.append("\(peterBrett)")
4949
logger.append("Note the lazy relation didn't update automatically once fetched.\nBut if we fetch a new instance by his id ...")
50-
logger.append("\(authorBox.get(peterBrett.id)?.description ?? "(fetch failed)")")
50+
logger.append("\(try authorBox.get(peterBrett.id)?.description ?? "(fetch failed)")")
5151
} catch {
5252
logger.append("❌ ERROR: \(error)")
5353
}

0 commit comments

Comments
 (0)