forked from shadowfacts/Tusker
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)
|
original(self, selector, sender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let exception {
|
||||||
|
SentrySDK.capture(exception: exception)
|
||||||
|
}
|
||||||
} as @convention(block) (UIStatusBarManager, AnyObject) -> Void)
|
} as @convention(block) (UIStatusBarManager, AnyObject) -> Void)
|
||||||
originalIMP = class_replaceMethod(UIStatusBarManager.self, selector, imp, "v@:@")
|
originalIMP = class_replaceMethod(UIStatusBarManager.self, selector, imp, "v@:@")
|
||||||
if originalIMP == nil {
|
if originalIMP == nil {
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
import Sentry
|
||||||
|
|
||||||
protocol TuskerSceneDelegate: UISceneDelegate {
|
protocol TuskerSceneDelegate: UISceneDelegate {
|
||||||
var window: UIWindow? { get }
|
var window: UIWindow? { get }
|
||||||
|
@ -31,11 +32,14 @@ extension TuskerSceneDelegate {
|
||||||
guard let window else { return }
|
guard let window else { return }
|
||||||
window.overrideUserInterfaceStyle = Preferences.shared.theme
|
window.overrideUserInterfaceStyle = Preferences.shared.theme
|
||||||
window.tintColor = Preferences.shared.accentColor.color
|
window.tintColor = Preferences.shared.accentColor.color
|
||||||
_ = catchNSException {
|
let exception = catchNSException {
|
||||||
let key = ["Controller", "Presentation", "root", "_"].reversed().joined()
|
let key = ["Controller", "Presentation", "root", "_"].reversed().joined()
|
||||||
if let rootPresentationController = window.value(forKey: key) as? UIPresentationController {
|
if let rootPresentationController = window.value(forKey: key) as? UIPresentationController {
|
||||||
rootPresentationController.overrideTraitCollection = UITraitCollection(pureBlackDarkMode: Preferences.shared.pureBlackDarkMode)
|
rootPresentationController.overrideTraitCollection = UITraitCollection(pureBlackDarkMode: Preferences.shared.pureBlackDarkMode)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if let exception {
|
||||||
|
SentrySDK.capture(exception: exception)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue