Skip to content

Commit af08b70

Browse files
authored
Fix crashpad handler path configuration in FAB pluging version (#1028)
* Fix crashpad handler path for fab * Update changelog
1 parent fa5e60e commit af08b70

File tree

5 files changed

+17
-16
lines changed

5 files changed

+17
-16
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
### Fixes
66

7+
- The FAB plugin version no longer opts out of Crashpad handler configuration ([#1028](https://github.com/getsentry/sentry-unreal/pull/1028))
78
- The FAB version of the plugin builds successfully on Android and iOS ([#1027](https://github.com/getsentry/sentry-unreal/pull/1027))
89

910
## 1.0.0-beta.6

plugin-dev/Source/Sentry/Private/Microsoft/MicrosoftSentrySubsystem.cpp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,6 @@ void FMicrosoftSentrySubsystem::InitWithSettings(const USentrySettings* Settings
3838
#endif
3939
}
4040

41-
void FMicrosoftSentrySubsystem::ConfigureHandlerPath(sentry_options_t* Options)
42-
{
43-
if (!FSentryModule::Get().IsMarketplaceVersion())
44-
{
45-
const FString HandlerPath = GetHandlerPath();
46-
47-
if (!FPaths::FileExists(HandlerPath))
48-
{
49-
UE_LOG(LogSentrySdk, Log, TEXT("Crashpad executable couldn't be found so Breakpad will be used instead. Please make sure that the plugin was rebuilt to avoid initialization failure."));
50-
}
51-
52-
sentry_options_set_handler_pathw(Options, *HandlerPath);
53-
}
54-
}
55-
5641
void FMicrosoftSentrySubsystem::ConfigureDatabasePath(sentry_options_t* Options)
5742
{
5843
sentry_options_set_database_pathw(Options, *GetDatabasePath());

plugin-dev/Source/Sentry/Private/Microsoft/MicrosoftSentrySubsystem.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ class FMicrosoftSentrySubsystem : public FGenericPlatformSentrySubsystem
1414
virtual void InitWithSettings(const USentrySettings* settings, USentryBeforeSendHandler* beforeSendHandler, USentryBeforeBreadcrumbHandler* beforeBreadcrumbHandler, USentryTraceSampler* traceSampler) override;
1515

1616
protected:
17-
virtual void ConfigureHandlerPath(sentry_options_t* Options) override;
1817
virtual void ConfigureDatabasePath(sentry_options_t* Options) override;
1918
virtual void ConfigureLogFileAttachment(sentry_options_t* Options) override;
2019

plugin-dev/Source/Sentry/Private/Windows/WindowsSentrySubsystem.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "SentryDefines.h"
88

99
#include "Misc/OutputDeviceRedirector.h"
10+
#include "Misc/Paths.h"
1011
#include "Windows/Infrastructure/WindowsSentryConverters.h"
1112
#include "Windows/WindowsPlatformStackWalk.h"
1213

@@ -57,6 +58,19 @@ static void PrintCrashLog(const sentry_ucontext_t* uctx)
5758
#endif // !UE_VERSION_OLDER_THAN(5, 0, 0)
5859
}
5960

61+
void FWindowsSentrySubsystem::ConfigureHandlerPath(sentry_options_t* Options)
62+
{
63+
const FString HandlerPath = GetHandlerPath();
64+
65+
if (!FPaths::FileExists(HandlerPath))
66+
{
67+
UE_LOG(LogSentrySdk, Log, TEXT("Crashpad executable couldn't be found so Breakpad will be used instead. Please make sure that the plugin was rebuilt to avoid initialization failure."));
68+
return;
69+
}
70+
71+
sentry_options_set_handler_pathw(Options, *HandlerPath);
72+
}
73+
6074
sentry_value_t FWindowsSentrySubsystem::OnCrash(const sentry_ucontext_t* uctx, sentry_value_t event, void* closure)
6175
{
6276
// Ensures that error message and corresponding callstack flushed to a log file (if available)

plugin-dev/Source/Sentry/Private/Windows/WindowsSentrySubsystem.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
class FWindowsSentrySubsystem : public FMicrosoftSentrySubsystem
1010
{
1111
protected:
12+
virtual void ConfigureHandlerPath(sentry_options_t* Options) override;
13+
1214
virtual FString GetHandlerExecutableName() const override { return TEXT("crashpad_handler.exe"); }
1315

1416
virtual sentry_value_t OnCrash(const sentry_ucontext_t* uctx, sentry_value_t event, void* closure) override;

0 commit comments

Comments
 (0)