diff --git a/MVMCoreUI/Notification/NotificationHandler.swift b/MVMCoreUI/Notification/NotificationHandler.swift index 1c20e1e3..8a84227e 100644 --- a/MVMCoreUI/Notification/NotificationHandler.swift +++ b/MVMCoreUI/Notification/NotificationHandler.swift @@ -373,20 +373,20 @@ open class NotificationHandler { guard let responseJSON = loadObject.responseJSON, let json = responseJSON.optionalDictionaryForKey(KeyTopAlert) else { return } Task { - await showNotification(for: json, delegateObject: delegateObject) + do { + try await showNotification(for: json, delegateObject: delegateObject) + } catch { + if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: "\(self)") { + MVMCoreUILoggingHandler.addError(toLog: errorObject) + } + } } } /// Converts the json to a model and creates the view and queues up the notification. - open func showNotification(for json: [AnyHashable: Any], delegateObject: MVMCoreUIDelegateObject?) async { - do { - let model = try NotificationModel.decode(json: json, delegateObject: delegateObject) - try await showNotification(for: model, delegateObject: delegateObject) - } catch { - if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: "\(self)") { - MVMCoreUILoggingHandler.addError(toLog: errorObject) - } - } + open func showNotification(for json: [AnyHashable: Any], delegateObject: MVMCoreUIDelegateObject?) async throws { + let model = try NotificationModel.decode(json: json, delegateObject: delegateObject) + try await showNotification(for: model, delegateObject: delegateObject) } // MARK: - Operation Handling