Skip to content

Commit

Permalink
Show crash report sending failure unconditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
kryksyh committed Oct 15, 2024
1 parent 60af155 commit ee20215
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
16 changes: 6 additions & 10 deletions crashreporter/CrashReportApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace
);

if(result != google_breakpad::RESULT_SUCCEEDED)
errorString = wxString::Format("SendMinidump filed with result: %s", StringifyReportResult(result));
errorString = wxString::Format("Failed to send crash report with error: %s", StringifyReportResult(result));

return result == google_breakpad::RESULT_SUCCEEDED;
}
Expand All @@ -94,7 +94,7 @@ namespace
files["comments.txt"] = commentsFilePath.ToStdString();
}

std::string response, error;
std::string response, resultErr;
bool success = google_breakpad::HTTPUpload::SendRequest(
url,
arguments,
Expand All @@ -104,10 +104,10 @@ namespace
std::string(),
&response,
NULL,
&error);
&resultErr);

if(!success)
errorString = wxString::Format("SendMinidump failed with error: %s", error.c_str());
error = wxString::Format("Failed to send crash report with error: %s", resultErr.c_str());

return success;
}
Expand Down Expand Up @@ -421,7 +421,7 @@ bool CrashReportApp::OnInit()
{
wxString error;
auto result = SendMinidump(mURL, mMinidumpPath, mArguments, wxEmptyString, error);
if(!result && mShowError)
if(!result)
wxMessageBox(error);
}
}
Expand Down Expand Up @@ -501,7 +501,6 @@ bool CrashReportApp::OnCmdLineParsed(wxCmdLineParser& parser)
}
mMinidumpPath = parser.GetParam(0);
mSilent = parser.Found("s");
mShowError = parser.Found("e");

return wxApp::OnCmdLineParsed(parser);
}
Expand Down Expand Up @@ -538,10 +537,7 @@ void CrashReportApp::ShowCrashReport(const wxString& header, const wxString& tex

if (!result)
{
if(mShowError)
wxMessageBox(error);
else
wxMessageBox(_("Failed to send crash report"));
wxMessageBox(error);
}
return result;
});
Expand Down
1 change: 0 additions & 1 deletion crashreporter/CrashReportApp.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class CrashReportApp final : public wxApp
std::map<std::string, std::string> mArguments;

bool mSilent{ false };
bool mShowError { false };
public:
bool OnInit() override;
void OnInitCmdLine(wxCmdLineParser& parser) override;
Expand Down

0 comments on commit ee20215

Please sign in to comment.