diff options
Diffstat (limited to 'src/zencore/sentryintegration.cpp')
| -rw-r--r-- | src/zencore/sentryintegration.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp index 8491bef64..61b735594 100644 --- a/src/zencore/sentryintegration.cpp +++ b/src/zencore/sentryintegration.cpp @@ -250,7 +250,7 @@ SentryIntegration::Initialize(const Config& Conf, const std::string& CommandLine if (SentryOptions == nullptr) { - // OOM — skip sentry entirely rather than crashing on the subsequent set calls + // OOM - skip sentry entirely rather than crashing on the subsequent set calls m_SentryErrorCode = -1; m_IsInitialized = true; return; @@ -261,14 +261,23 @@ SentryIntegration::Initialize(const Config& Conf, const std::string& CommandLine sentry_options_set_logger(SentryOptions, SentryLogFunction, this); sentry_options_set_environment(SentryOptions, Conf.Environment.empty() ? "production" : Conf.Environment.c_str()); - std::string SentryAttachmentsPath = Conf.AttachmentsPath; - if (!SentryAttachmentsPath.empty()) + for (const std::filesystem::path& AttachmentPath : Conf.AttachmentPaths) { - if (SentryAttachmentsPath.starts_with("\\\\?\\")) + if (AttachmentPath.empty()) { - SentryAttachmentsPath = SentryAttachmentsPath.substr(4); + continue; } - sentry_options_add_attachment(SentryOptions, SentryAttachmentsPath.c_str()); +# if ZEN_PLATFORM_WINDOWS + const std::wstring Wide = AttachmentPath.wstring(); + const wchar_t* WPath = Wide.c_str(); + if (Wide.starts_with(L"\\\\?\\")) + { + WPath += 4; + } + sentry_options_add_attachmentw(SentryOptions, WPath); +# else + sentry_options_add_attachment(SentryOptions, AttachmentPath.string().c_str()); +# endif } sentry_options_set_release(SentryOptions, ZEN_CFG_VERSION); |