From 4b5cbdf55efd98fb7d50e4f4de965753b5d18a80 Mon Sep 17 00:00:00 2001 From: Jake Welton Date: Mon, 29 Apr 2024 10:15:21 +0100 Subject: [PATCH] Comment out crash handler registration --- .../RollbarCrashMonitor_NSException.m | 42 ++++++++++--------- 1 file changed, 23 insertions(+), 19 deletions(-) diff --git a/RollbarNotifier/Sources/RollbarCrash/Monitors/RollbarCrashMonitor_NSException.m b/RollbarNotifier/Sources/RollbarCrash/Monitors/RollbarCrashMonitor_NSException.m index 9306bbe4..087812d6 100644 --- a/RollbarNotifier/Sources/RollbarCrash/Monitors/RollbarCrashMonitor_NSException.m +++ b/RollbarNotifier/Sources/RollbarCrash/Monitors/RollbarCrashMonitor_NSException.m @@ -125,25 +125,29 @@ static void handleUncaughtException(NSException* exception) { static void setEnabled(bool isEnabled) { - if(isEnabled != g_isEnabled) - { - g_isEnabled = isEnabled; - if(isEnabled) - { - RCLOG_DEBUG(@"Backing up original handler."); - g_previousUncaughtExceptionHandler = NSGetUncaughtExceptionHandler(); - - RCLOG_DEBUG(@"Setting new handler."); - NSSetUncaughtExceptionHandler(&handleUncaughtException); - RollbarCrashHandler.sharedInstance.uncaughtExceptionHandler = &handleUncaughtException; - RollbarCrashHandler.sharedInstance.currentSnapshotUserReportedExceptionHandler = &handleCurrentSnapshotUserReportedException; - } - else - { - RCLOG_DEBUG(@"Restoring original handler."); - NSSetUncaughtExceptionHandler(g_previousUncaughtExceptionHandler); - } - } +// Wise: Wise has tooling already in place for crash reports, so we don't want to set a crash handler when +// setting up Rollbar. Currently there's no option to disable this from the public API of the Rollbar SDK. +// Rollbar have placed this into their feature backlog, which we should adopt once available. +// +// if(isEnabled != g_isEnabled) +// { +// g_isEnabled = isEnabled; +// if(isEnabled) +// { +// RCLOG_DEBUG(@"Backing up original handler."); +// g_previousUncaughtExceptionHandler = NSGetUncaughtExceptionHandler(); +// +// RCLOG_DEBUG(@"Setting new handler."); +// NSSetUncaughtExceptionHandler(&handleUncaughtException); +// RollbarCrashHandler.sharedInstance.uncaughtExceptionHandler = &handleUncaughtException; +// RollbarCrashHandler.sharedInstance.currentSnapshotUserReportedExceptionHandler = &handleCurrentSnapshotUserReportedException; +// } +// else +// { +// RCLOG_DEBUG(@"Restoring original handler."); +// NSSetUncaughtExceptionHandler(g_previousUncaughtExceptionHandler); +// } +// } } static bool isEnabled(void)