Fixes logging non-AltServerErrors as AltServerError.underlyingError

This commit is contained in:
nythepegasus
2024-05-06 20:33:29 -04:00
committed by ny
parent 7edb5716b7
commit 31a3323ef2

View File

@@ -68,7 +68,12 @@ public class LoggedError: NSManagedObject, Fetchable
self.date = date
self._operation = operation?.rawValue
let nsError = error as NSError
let nsError: NSError
if let error = error as? ALTServerError, error.code == .underlyingError, let underlyingError = error.underlyingError {
nsError = underlyingError as NSError
} else {
nsError = error as NSError
}
self.domain = nsError.domain
self.code = Int32(nsError.code)
self.userInfo = nsError.userInfo