ONEAPP-4157: Code review cleanup
This commit is contained in:
parent
5263f7db1a
commit
02b7d8bd93
@ -373,20 +373,20 @@ open class NotificationHandler {
|
|||||||
guard let responseJSON = loadObject.responseJSON,
|
guard let responseJSON = loadObject.responseJSON,
|
||||||
let json = responseJSON.optionalDictionaryForKey(KeyTopAlert) else { return }
|
let json = responseJSON.optionalDictionaryForKey(KeyTopAlert) else { return }
|
||||||
Task {
|
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.
|
/// 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 {
|
open func showNotification(for json: [AnyHashable: Any], delegateObject: MVMCoreUIDelegateObject?) async throws {
|
||||||
do {
|
let model = try NotificationModel.decode(json: json, delegateObject: delegateObject)
|
||||||
let model = try NotificationModel.decode(json: json, delegateObject: delegateObject)
|
try await showNotification(for: model, delegateObject: delegateObject)
|
||||||
try await showNotification(for: model, delegateObject: delegateObject)
|
|
||||||
} catch {
|
|
||||||
if let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: "\(self)") {
|
|
||||||
MVMCoreUILoggingHandler.addError(toLog: errorObject)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Operation Handling
|
// MARK: - Operation Handling
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user