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:
Angelo Stavrow 2022-05-26 07:31:11 -04:00
parent b017e21e06
commit c5b611b39e
No known key found for this signature in database
GPG Key ID: 1A49C7064E060EEE

View File

@ -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!")
} }
} }