Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions frontend/utility/CrashHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ using CrashLogUpdateResult = OBS::CrashHandler::CrashLogUpdateResult;

namespace {

constexpr std::string_view crashSentinelPath = "obs-studio";
constexpr std::string_view crashSentinelPrefix = "crash_sentinel_";
constexpr std::string_view crashSentinelPath = "obs-studio/.sentinel";
constexpr std::string_view crashSentinelPrefix = "run_";
constexpr std::string_view crashUploadURL = "https://obsproject.com/logs/upload";

#ifndef NDEBUG
Expand Down Expand Up @@ -190,8 +190,14 @@ void CrashHandler::checkCrashState()
std::filesystem::path crashSentinelPath = crashSentinelFile_.parent_path();

if (!std::filesystem::exists(crashSentinelPath)) {
blog(LOG_ERROR, "Crash sentinel location '%s' does not exist", crashSentinelPath.u8string().c_str());
return;
try {
std::filesystem::create_directory(crashSentinelPath);
} catch (const std::filesystem::filesystem_error &error) {
blog(LOG_ERROR,
"Crash sentinel location '%s' does not exist and unable to create directory:\n%s.",
crashSentinelPath.u8string().c_str(), error.what());
return;
}
}

for (const auto &entry : std::filesystem::directory_iterator(crashSentinelPath)) {
Expand Down
Loading