Report caught NSExceptions to Sentry
This commit is contained in:
parent
2a892fa6ec
commit
762d298c06
|
@ -151,6 +151,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
|
|||
original(self, selector, sender)
|
||||
}
|
||||
}
|
||||
if let exception {
|
||||
SentrySDK.capture(exception: exception)
|
||||
}
|
||||
} as @convention(block) (UIStatusBarManager, AnyObject) -> Void)
|
||||
originalIMP = class_replaceMethod(UIStatusBarManager.self, selector, imp, "v@:@")
|
||||
if originalIMP == nil {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
//
|
||||
|
||||
import UIKit
|
||||
import Sentry
|
||||
|
||||
protocol TuskerSceneDelegate: UISceneDelegate {
|
||||
var window: UIWindow? { get }
|
||||
|
@ -31,11 +32,14 @@ extension TuskerSceneDelegate {
|
|||
guard let window else { return }
|
||||
window.overrideUserInterfaceStyle = Preferences.shared.theme
|
||||
window.tintColor = Preferences.shared.accentColor.color
|
||||
_ = catchNSException {
|
||||
let exception = catchNSException {
|
||||
let key = ["Controller", "Presentation", "root", "_"].reversed().joined()
|
||||
if let rootPresentationController = window.value(forKey: key) as? UIPresentationController {
|
||||
rootPresentationController.overrideTraitCollection = UITraitCollection(pureBlackDarkMode: Preferences.shared.pureBlackDarkMode)
|
||||
}
|
||||
}
|
||||
if let exception {
|
||||
SentrySDK.capture(exception: exception)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue