error.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. // SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "common/logging/log.h"
  4. #include "core/frontend/applets/error.h"
  5. namespace Core::Frontend {
  6. ErrorApplet::~ErrorApplet() = default;
  7. void DefaultErrorApplet::ShowError(Result error, std::function<void()> finished) const {
  8. LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})",
  9. error.module.Value(), error.description.Value(), error.raw);
  10. }
  11. void DefaultErrorApplet::ShowErrorWithTimestamp(Result error, std::chrono::seconds time,
  12. std::function<void()> finished) const {
  13. LOG_CRITICAL(
  14. Service_Fatal,
  15. "Application requested error display: {:04X}-{:04X} (raw={:08X}) with timestamp={:016X}",
  16. error.module.Value(), error.description.Value(), error.raw, time.count());
  17. }
  18. void DefaultErrorApplet::ShowCustomErrorText(Result error, std::string main_text,
  19. std::string detail_text,
  20. std::function<void()> finished) const {
  21. LOG_CRITICAL(Service_Fatal,
  22. "Application requested custom error with error_code={:04X}-{:04X} (raw={:08X})",
  23. error.module.Value(), error.description.Value(), error.raw);
  24. LOG_CRITICAL(Service_Fatal, " Main Text: {}", main_text);
  25. LOG_CRITICAL(Service_Fatal, " Detail Text: {}", detail_text);
  26. }
  27. } // namespace Core::Frontend