Skip to content

Commit

Permalink
Tweak crashHandlingProviderTestCrash()
Browse files Browse the repository at this point in the history
  • Loading branch information
past-due committed Jun 25, 2024
1 parent 8a82eb4 commit a780fb1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/wzcrashhandlingproviders.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
#include "activity.h"
#include "modding.h"

#include <chrono>
#include <thread>

/* Crash-handling providers */

#if defined(WZ_CRASHHANDLING_PROVIDER_SENTRY)
Expand Down Expand Up @@ -515,6 +518,10 @@ bool crashHandlingProviderTestCrash()
#elif defined(WZ_CRASHHANDLING_PROVIDER_SENTRY)
// Sentry crash-handling provider
if (!enabledSentryProvider) { return false; }
// test reporting exceptions
crashHandlingProviderCaptureException(__FUNCTION__, "testexception", "Test crash initiated", false, true);
std::this_thread::sleep_for(std::chrono::seconds(5)); // (hopefully enough time for the exception to be sent in the background...)
// trigger an actual crash
# if defined(WZ_OS_WIN)
RaiseException(0xE000DEAD, EXCEPTION_NONCONTINUABLE, 0, 0);
return false;
Expand Down

0 comments on commit a780fb1

Please sign in to comment.