From 02b7d8bd93d7f1913791543e9c7996123bf9a067 Mon Sep 17 00:00:00 2001 From: Scott Pfeil Date: Wed, 7 Jun 2023 12:06:02 -0400 Subject: [PATCH] ONEAPP-4157: Code review cleanup --- .../Notification/NotificationHandler.swift | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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