Stub ErrorCommonArg

This commit is contained in:
Dima 2022-11-20 12:34:46 +03:00 committed by Billy Laws
parent 68253fe995
commit dcc3047ba8
2 changed files with 19 additions and 0 deletions

View File

@ -21,6 +21,9 @@ namespace skyline::applet {
Logger::Debug("ErrorApplet: version: 0x{:X}, type: 0x{:X}", commonArg.apiVersion, errorCommonHeader.type);
switch (errorCommonHeader.type) {
case ErrorType::ErrorCommonArg:
HandleErrorCommonArg();
break;
case ErrorType::ApplicationErrorArg:
HandleApplicationErrorArg();
break;
@ -34,6 +37,11 @@ namespace skyline::applet {
return {};
}
void ErrorApplet::HandleErrorCommonArg() {
auto errorCommonArg{errorStorage->GetSpan().as<ErrorCommonArg>()};
Logger::Error("ErrorApplet: error code: 0x{:X}, result: 0x{:X}", errorCommonArg.errorCode, errorCommonArg.result);
}
void ErrorApplet::HandleApplicationErrorArg() {
auto applicationErrorStorage{errorStorage->GetSpan().as<ApplicationErrorArg>()};

View File

@ -41,6 +41,15 @@ namespace skyline::applet {
};
static_assert(sizeof(ErrorCommonHeader) == 0x8);
/**
* @url https://switchbrew.org/wiki/Error_Applet#ErrorCommonArg
*/
struct ErrorCommonArg {
ErrorCommonHeader header;
u64 errorCode;
Result result;
};
struct ApplicationErrorArg {
ErrorCommonHeader commonHeader;
u32 errorNumber;
@ -54,6 +63,8 @@ namespace skyline::applet {
std::shared_ptr<service::am::IStorage> errorStorage;
void HandleErrorCommonArg();
void HandleApplicationErrorArg();
public: