summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/am/applets/error.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/core/hle/service/am/applets/error.cpp b/src/core/hle/service/am/applets/error.cpp
index 04774bedc..af3a900f8 100644
--- a/src/core/hle/service/am/applets/error.cpp
+++ b/src/core/hle/service/am/applets/error.cpp
@@ -9,8 +9,10 @@
9#include "common/string_util.h" 9#include "common/string_util.h"
10#include "core/core.h" 10#include "core/core.h"
11#include "core/frontend/applets/error.h" 11#include "core/frontend/applets/error.h"
12#include "core/hle/kernel/process.h"
12#include "core/hle/service/am/am.h" 13#include "core/hle/service/am/am.h"
13#include "core/hle/service/am/applets/error.h" 14#include "core/hle/service/am/applets/error.h"
15#include "core/reporter.h"
14 16
15namespace Service::AM::Applets { 17namespace Service::AM::Applets {
16 18
@@ -143,9 +145,12 @@ void Error::Execute() {
143 } 145 }
144 146
145 const auto callback = [this] { DisplayCompleted(); }; 147 const auto callback = [this] { DisplayCompleted(); };
148 const auto title_id = Core::CurrentProcess()->GetTitleID();
149 const auto& reporter{Core::System::GetInstance().GetReporter()};
146 150
147 switch (mode) { 151 switch (mode) {
148 case ErrorAppletMode::ShowError: 152 case ErrorAppletMode::ShowError:
153 reporter.SaveErrorReport(title_id, error_code);
149 frontend.ShowError(error_code, callback); 154 frontend.ShowError(error_code, callback);
150 break; 155 break;
151 case ErrorAppletMode::ShowSystemError: 156 case ErrorAppletMode::ShowSystemError:
@@ -156,14 +161,18 @@ void Error::Execute() {
156 const auto& detail_text = 161 const auto& detail_text =
157 system ? args->system_error.detail_text : args->application_error.detail_text; 162 system ? args->system_error.detail_text : args->application_error.detail_text;
158 163
159 frontend.ShowCustomErrorText( 164 const auto main_text_string =
160 error_code, 165 Common::StringFromFixedZeroTerminatedBuffer(main_text.data(), main_text.size());
161 Common::StringFromFixedZeroTerminatedBuffer(main_text.data(), main_text.size()), 166 const auto detail_text_string =
162 Common::StringFromFixedZeroTerminatedBuffer(detail_text.data(), detail_text.size()), 167 Common::StringFromFixedZeroTerminatedBuffer(detail_text.data(), detail_text.size());
163 callback); 168
169 reporter.SaveErrorReport(title_id, error_code, main_text_string, detail_text_string);
170 frontend.ShowCustomErrorText(error_code, main_text_string, detail_text_string, callback);
164 break; 171 break;
165 } 172 }
166 case ErrorAppletMode::ShowErrorRecord: 173 case ErrorAppletMode::ShowErrorRecord:
174 reporter.SaveErrorReport(title_id, error_code,
175 fmt::format("{:016X}", args->error_record.posix_time));
167 frontend.ShowErrorWithTimestamp( 176 frontend.ShowErrorWithTimestamp(
168 error_code, std::chrono::seconds{args->error_record.posix_time}, callback); 177 error_code, std::chrono::seconds{args->error_record.posix_time}, callback);
169 break; 178 break;