Consistent theme error messages on iOS

This commit is contained in:
Stuart Breckenridge 2021-09-23 20:16:09 +08:00
parent e9b84d9219
commit 88674d2fc4
1 changed files with 3 additions and 3 deletions

View File

@ -19,13 +19,13 @@ extension UIViewController {
let errorTitle = NSLocalizedString("Error", comment: "Error") let errorTitle = NSLocalizedString("Error", comment: "Error")
switch decodingError { switch decodingError {
case .typeMismatch(let type, _): case .typeMismatch(let type, _):
let str = "Type '\(type)' mismatch." let str = "This theme cannot be used because the type—'\(type)'—is mismatched."
presentError(title: errorTitle, message: str, dismiss: dismiss) presentError(title: errorTitle, message: str, dismiss: dismiss)
case .valueNotFound(let value, _): case .valueNotFound(let value, _):
let str = "Value '\(value)' not found." let str = "This theme cannot be used because the value—'\(value)'—is not found."
presentError(title: errorTitle, message: str, dismiss: dismiss) presentError(title: errorTitle, message: str, dismiss: dismiss)
case .keyNotFound(let codingKey, _): case .keyNotFound(let codingKey, _):
let str = "Key '\(codingKey.stringValue)' not found." let str = "This theme cannot be used because the key—'\(codingKey.stringValue)'—is not found."
presentError(title: errorTitle, message: str, dismiss: dismiss) presentError(title: errorTitle, message: str, dismiss: dismiss)
case .dataCorrupted( _): case .dataCorrupted( _):
presentError(title: errorTitle, message: error.localizedDescription, dismiss: dismiss) presentError(title: errorTitle, message: error.localizedDescription, dismiss: dismiss)