MCPcopy Create free account
hub / github.com/audacity/audacity / AddUserComment

Method AddUserComment

libraries/lib-sentry-reporting/SentryReport.cpp:328–355  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

326}
327
328void Report::ReportImpl::AddUserComment(const std::string& message)
329{
330 // We only allow adding comment to exceptions now
331 if (!mDocument.HasMember("exception") || message.empty())
332 return;
333
334 rapidjson::Value& topException = mDocument["exception"]["values"][0];
335
336 if (!topException.IsObject())
337 return;
338
339 rapidjson::Value& mechanism = topException["mechanism"];
340
341 // Create a data object if it still does not exist
342 if (!mechanism.HasMember("data"))
343 {
344 mechanism.AddMember(
345 "data", rapidjson::Value(rapidjson::kObjectType),
346 mDocument.GetAllocator());
347 }
348
349 // Add a comment itself
350 mechanism["data"].AddMember(
351 "user_comment",
352 rapidjson::Value(
353 message.data(), message.length(), mDocument.GetAllocator()),
354 mDocument.GetAllocator());
355}
356
357
358void Report::ReportImpl::Send(CompletionHandler completionHandler) const

Callers 1

OnSendMethod · 0.80

Calls 3

emptyMethod · 0.45
dataMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected