Let's say I have the following PassthroughSubject, somewhere in an ObservableObject:
@Published var errorOccured = PassthroughSubject<(), Error>()
I send an error to it with:
self.errorOccured.send(completion: .failure(error))
How can I be notified in a View whenever an error occurs? I know that with onReceive I can be notified of values, but I am interested in errors.