Updates LaunchViewController error alert to include more detail

Uses debugDescription over localizedDescription, because that makes it significantly easier to debug the underlying problem from a screenshot.
This commit is contained in:
Riley Testut
2022-09-20 13:19:17 -05:00
committed by Joseph Mattello
parent 54ccb9611e
commit c80740e590

View File

@@ -172,7 +172,19 @@ extension LaunchViewController
{
let title = error.userInfo[NSLocalizedFailureErrorKey] as? String ?? NSLocalizedString("Unable to Launch SideStore", comment: "")
let alertController = UIAlertController(title: title, message: error.localizedDescription, preferredStyle: .alert)
let errorDescription: String
if #available(iOS 14.5, *)
{
let errorMessages = [error.debugDescription] + error.underlyingErrors.map { ($0 as NSError).debugDescription }
errorDescription = errorMessages.joined(separator: "\n\n")
}
else
{
errorDescription = error.debugDescription
}
let alertController = UIAlertController(title: title, message: errorDescription, preferredStyle: .alert)
alertController.addAction(UIAlertAction(title: NSLocalizedString("Retry", comment: ""), style: .default, handler: { (action) in
self.handleLaunchConditions()
}))