code review

This commit is contained in:
Kyle Matthew Hedden 2023-03-15 09:04:58 -04:00
parent 289a31af24
commit 04e85db91e

View File

@ -165,13 +165,13 @@ import MVMCore
if let decodingError = parsingError as? DecodingError {
switch (decodingError) {
case .keyNotFound(let codingKey, let context):
return "Error parsing template. Key \(codingKey.stringValue) was not found @ \(context.codingPath.map { return $0.stringValue })"
return "Error parsing template. Required key \(codingKey.stringValue) was not found @ \(context.codingPath.map { return $0.stringValue })"
case .valueNotFound(_, let context):
return "Error parsing template. Value not found @ \(context.codingPath.map { return $0.stringValue })"
case .typeMismatch(_, let context):
return "Error parsing template. Type mismatch @ \(context.codingPath.map { return $0.stringValue })"
return "Error parsing template. Value type mismatch @ \(context.codingPath.map { return $0.stringValue })"
case .dataCorrupted(let context):
return "Error parsing template. Data corrupted @ \(context.codingPath.map { return $0.stringValue })"
@ -475,7 +475,14 @@ import MVMCore
open func handleAction(error: Error, model: ActionModelProtocol, additionalData: [AnyHashable : Any]?, delegateObject: DelegateObject?) {
let errorObject = MVMCoreErrorObject.createErrorObject(for: error, location: MVMCoreActionHandler.getErrorLocation(with: delegateObject?.actionDelegate, actionType: model.actionType))!
errorObject.silentError = (error as? MVMCoreErrorObject)?.silentError ?? false // Prefer incoming settings, then default to loud.
switch (model) {
case let model as ActionOpenPageModel:
errorObject.silentError = model.background ?? false
default:
errorObject.silentError = false
}
MVMCoreUIActionHandler.shared()?.defaultHandleActionError(errorObject, additionalData: additionalData)
}