error.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2019 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #include "core/frontend/applets/error.h"
  5. namespace Core::Frontend {
  6. ErrorApplet::~ErrorApplet() = default;
  7. void DefaultErrorApplet::ShowError(ResultCode error, std::function<void()> finished) const {
  8. LOG_CRITICAL(Service_Fatal, "Application requested error display: {:04}-{:04} (raw={:08X})",
  9. static_cast<u32>(error.module.Value()), error.description.Value(), error.raw);
  10. }
  11. void DefaultErrorApplet::ShowErrorWithTimestamp(ResultCode 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. static_cast<u32>(error.module.Value()), error.description.Value(), error.raw, time.count());
  17. }
  18. void DefaultErrorApplet::ShowCustomErrorText(ResultCode 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. static_cast<u32>(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