mirror of
https://github.com/writeas/writefreely-swiftui-multiplatform.git
synced 2024-11-15 01:11:02 +00:00
Add FIXME to track silent failure on fetching collections
As collections are fetched and added to the `list` property in the CollectionListModel’s initializer, it’s tricky to throw an error here: we call it as a property initializer in CollectionListView, which cannot throw. Consider refactoring this logic such that we’re using, for example, a @FetchRequest in CollectionListView instead.
This commit is contained in:
parent
b017e21e06
commit
c5b611b39e
@ -19,6 +19,7 @@ class CollectionListModel: NSObject, ObservableObject {
|
|||||||
try collectionsController.performFetch()
|
try collectionsController.performFetch()
|
||||||
list = collectionsController.fetchedObjects ?? []
|
list = collectionsController.fetchedObjects ?? []
|
||||||
} catch {
|
} catch {
|
||||||
|
// FIXME: Errors cannot be thrown out of the CollectionListView property initializer
|
||||||
print("Failed to fetch collections!")
|
print("Failed to fetch collections!")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user