diff --git a/AltServer/ErrorDetailsViewController.swift b/AltServer/ErrorDetailsViewController.swift index 6f9fd1c7..5ea59b7f 100644 --- a/AltServer/ErrorDetailsViewController.swift +++ b/AltServer/ErrorDetailsViewController.swift @@ -44,5 +44,20 @@ private extension ErrorDetailsViewController let detailedDescription = error.formattedDetailedDescription(with: font) self.detailedDescriptionLabel.attributedStringValue = detailedDescription } + + @IBAction func searchFAQ(_ sender: NSButton) + { + guard let error else { return } + + let baseURL = URL(string: "https://faq.altstore.io/getting-started/error-codes")! + var components = URLComponents(url: baseURL, resolvingAgainstBaseURL: false)! + + let nsError = error as NSError + let query = [nsError.domain, "\(error.displayCode)"].joined(separator: "+") + components.queryItems = [URLQueryItem(name: "q", value: query)] + + let url = components.url ?? baseURL + NSWorkspace.shared.open(url) + } }