ios_catalogue1-9 Exercise 2: Alerts and the Error Centre ========================================================= Test: in CatalogueRepository.save, temporarily add as the first line throw CocoaError(.fileWriteUnknown) (remove it afterwards). Expected: - Fill the form, tap Save: an alert "Couldn't save" appears over the form with OK. The sheet stays open and the typed text, type and tags are all still there (the draft is untouched). Tapping OK dismisses only the alert. - error.localizedDescription for a Cocoa error is usually readable ("The file couldn't be saved."); for SwiftData internal errors it can be technical. Note what yours says; if it is unfriendly, show your own sentence ("Couldn't save. Please try again.") and log the technical error. For delete: make delete throw in the same way. Open an item, tap Delete and confirm. The detail screen is dismissed, then the root alert "Something went wrong / Couldn't delete the item: ..." appears, and the item is still in the list. Note whether the alert appears reliably while the screen is still animating away; if it is dropped, delay the report slightly or present from the list instead, and record your iOS version. Remember to supply .environment(ErrorCenter()) in any preview of DetailView, or the preview crashes.