Error Applet: Difference between revisions

m Fixed a typo
No edit summary
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This is the applet presented when a title displays an error message.
This is the applet presented when a title displays an error message. See [[AM_services#Library_Applets|Library Applets]].
See [[AM_services#Library_Applets]]. The error applet expects two [[AM_services#IStorage|IStorage]] inputs and no output.


== ErrorConfig ==
All errors displayed by this applet get logged and can be viewed under 'Settings' > 'Support' > 'Error History'.


This has size 0x1018 and contains the error code, a short description of the error and a more detailed description of the error, displayed when the user clicks on "Details". Typically, all unused values can be set to zero. The first byte should be set to 1 if a custom error message is to be displayed. Otherwise, a default error message will be shown.
On pre-5.0.0 the specified LanguageCode has to be valid, otherwise a fatal-error is thrown. With [5.0.0+] it will use en-US when the LanguageCode is invalid.


The error code is stored at offsets 0x8, containing the first part of the code, and 0xC, containing the second part of the code. Those values are expected to be u32's.
= ErrorContext =
This is "nn::err::ErrorContext". This is a 0x200-byte struct.


The short description of the error is stored as a char* at offset 0x18, the long description of the error is stored as a char* at offset 0x818.
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Type
|-
| 0x1 || 0x7 || Padding
|-
| 0x8 || 0x1F4 || Data
|-
| 0x1FC || 0x4 || Result
|}


== Usage ==  
This is used to set specific error contexts for [[Error_Report_services#SubmitContext|erpt:c]].
User-processes should push a common arguments struct as well as the typical ErrorConfig struct. Since the error applet doesn't have any output, user-processes can then directly join the applet and wait for it to finish.
 
Depending on '''Type''', different error report fields will be attached and sent:
* Type 0: None;
* Type 1: [[Error_Report_services#FieldId|ServerFqdn]], [[Error_Report_services#FieldId|ServerIpAddress]], [7.0.0+] [[Error_Report_services#FieldId|ServerErrorCode]] and either [8.0.0+] [[Error_Report_services#FieldId|AkamaiReferenceId]], [13.0.0+] [[Error_Report_services#FieldId|LumenRequestId]] or [13.0.0+] [[Error_Report_services#FieldId|LlnwLlid]];
* Type 2: [[Error_Report_services#FieldId|FileSystemPath]] and [[Error_Report_services#FieldId|ResultBacktrace]];
* Type 3: [[Error_Report_services#FieldId|WebMediaPlayerOpenUrl]] and [[Error_Report_services#FieldId|WebMediaPlayerLastSocketErrors]];
* Type 4: [5.0.0+] [[Error_Report_services#FieldId|LcsApplicationId]], [[Error_Report_services#FieldId|LcsContentMetaKeyIdList]], [[Error_Report_services#FieldId|LcsContentMetaKeyVersionList]], [[Error_Report_services#FieldId|LcsContentMetaKeyTypeList]], [[Error_Report_services#FieldId|LcsSenderFlag]], [[Error_Report_services#FieldId|LcsApplicationRequestFlag]], [[Error_Report_services#FieldId|LcsHasExFatDriverFlag]], [[Error_Report_services#FieldId|LcsIpAddress]] and  [[Error_Report_services#FieldId|ResultBacktrace]].
* Type 5: [12.0.0+] [[Error_Report_services#FieldId|BrowserCertificateHostName]], [[Error_Report_services#FieldId|BrowserCertificateCommonName]] and [[Error_Report_services#FieldId|BrowserCertificateOrganizationalUnitName]].
 
= ErrorViewerStartupParamCommon =
This is "nn::err::ErrorViewerStartupParamCommon". This is a 0x4-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || [[#ErrorType|ErrorType]]
|-
| 0x1 || 0x1 || IsJumpEnabled
|-
| 0x2 || 0x2 || Reserved
|}
 
= ErrorViewerStartupParamForApplicationError =
This is "nn::err::ErrorViewerStartupParamForApplicationError". This is a 0x1014-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x4 || [[#ApplicationErrorCodeNumber|ApplicationErrorCodeNumber]]
|-
| 0xC || 0x8 || [[Settings_services#LanguageCode|LanguageCode]]
|-
| 0x14 || 0x800 || DialogMessage (UTF-8 string)
|-
| 0x814 || 0x800 || FullScreenMessage (UTF-8 string, displayed when the user clicks on "Details" and when not set this disables displaying "Details")
|}
 
[10.0.0+] [[Applet_Manager_services#GetMainAppletApplicationControlProperty|GetMainAppletApplicationControlProperty]] is now used internally by the applet, on failure the applet will throw a fatalerr. Hence, ApplicationError can't be used from non-Applications (such as LibraryApplet) anymore.
 
= ErrorViewerStartupParamForEula =
This is "nn::err::ErrorViewerStartupParamForEula". This is a 0xC-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x4 || [[Settings_services#RegionCode_2|RegionCode]]
|}
 
* ErrorType = 3. Displays the EULA.
 
= ErrorViewerStartupParamForParentalControl =
This is "nn::err::ErrorViewerStartupParamForParentalControl". This is a 0xC-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x4 || PctlResultRestricted
|}
 
Used where a Result error would have been displayed with ErrorType=0, for module=PCTL errors with desc 100-119. For this the applet will display the following dialog (without report logging): "This software is restricted by Parental Controls".
 
= ErrorViewerStartupParamForRecordedApplicationError =
This is "nn::err::ErrorViewerStartupParamForRecordedApplicationError". This is a 0x820-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x4 || [[#ApplicationErrorCodeNumber|ApplicationErrorCodeNumber]]
|-
| 0xC || 0x4 || Reserved
|-
| 0x10 || 0x8 || TimeOfOccurrence (u64 PosixTime)
|-
| 0x18 || 0x8 || [[NS_services#ApplicationErrorCodeCategory|ApplicationErrorCodeCategory]]
|-
| 0x20 || 0x800 || Message (UTF-8 string)
|}
 
= ErrorViewerStartupParamForRecordedSystemData =
This is "nn::err::ErrorViewerStartupParamForRecordedSystemData". This is a 0x18-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x8 || [[#ErrorCode|ErrorCode]]
|-
| 0x10 || 0x8 || TimeOfOccurrence (u64 PosixTime)
|}
 
The applet does not log an error report for this. Used by [[qlaunch]] for viewing previously logged errors via the "View the Error" button.
 
= ErrorViewerStartupParamForRecordedSystemError =
This is "nn::err::ErrorViewerStartupParamForRecordedSystemError". This is a 0x818-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x8 || [[#ErrorCode|ErrorCode]]
|-
| 0x10 || 0x8 || TimeOfOccurrence (u64 PosixTime)
|-
| 0x18 || 0x800 || Message (UTF-8 string)
|}
 
= ErrorViewerStartupParamForSystemData =
This is "nn::err::ErrorViewerStartupParamForSystemData". This is a 0x14-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x1 || HasResultBacktrace
|-
| 0x6 || 0x1 || IsErrorCode
|-
| 0x7 || 0x1 || [4.0.0+] HasErrorContext ([1.0.0-3.0.2] Reserved)
|-
| 0x8 || 0x8 || [[#ErrorCode|ErrorCode]]
|-
| 0x10 || 0x4 || Result
|}
 
ShowError: ErrorType=0, IsJumpEnabled={varies}, HasErrorContext={set when ErrorContext used}.
* If the input Result is 0xC8A2, the applet will display a special dialog regarding the current application requiring a software update, with buttons "Later" and "Restart". The official user-process name for this is <code>ShowUnacceptableApplicationVersionError</code>.
* [3.0.0+] There's also special dialog handling for Result 0xCAA2. The official user-process name for this is <code>ShowUnacceptableAddOnContentVersionError</code>.
 
= ErrorViewerStartupParamForSystemError =
This is "nn::err::ErrorViewerStartupParamForSystemError". This is a 0x1018-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x1 || [4.0.0+] HasErrorContext ([1.0.0-3.0.2] Reserved)
|-
| 0x6 || 0x2 || Reserved
|-
| 0x8 || 0x8 || [[#ErrorCode|ErrorCode]]
|-
| 0x10 || 0x8 || [[Settings_services#LanguageCode|LanguageCode]]
|-
| 0x18 || 0x800 || DialogMessage (UTF-8 string)
|-
| 0x818 || 0x800 || FullScreenMessage (UTF-8 string, displayed when the user clicks on "Details" and when not set this disables displaying "Details")
|}
 
= ErrorViewerStartupParamForSystemUpdateEula =
This is "nn::err::ErrorViewerStartupParamForSystemUpdateEula". This is a 0xC-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorViewerStartupParamCommon|Common]]
|-
| 0x4 || 0x1 || Version
|-
| 0x5 || 0x3 || Reserved
|-
| 0x8 || 0x4 || [[Settings_services#RegionCode_2|RegionCode]]
|}
 
* ErrorType = 8. Displays the system-update EULA. Uses an additional IStorage containing [[#EulaData|EulaData]], from [[Applet_Manager_services#CreateTransferMemoryStorage]] with flag=false.
 
= ErrorViewerReturnValue =
This is "nn::err::ErrorViewerReturnValue". This is a 0x2-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1 || Version
|-
| 0x1 || 0x1 || [[#ErrorViewerJumpDestination|Destination]]
|}
 
= ApplicationErrorArg =
This is "nn::err::ApplicationErrorArg". This is a 0x1014-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1014 || [[#ErrorViewerStartupParamForApplicationError|StartupParam]]
|}
 
= SystemErrorArg =
This is "nn::err::SystemErrorArg". This is a 0x1028-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x1018 || [[#ErrorViewerStartupParamForSystemError|StartupParam]]
|-
| 0x1018 || 0x9 || [4.0.0+] ServerCode
|-
| 0x1021 || 0x7 || [4.0.0+] Reserved
|}
 
= ErrorType =
This is "nn::err::ErrorType".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || SystemData
|-
| 1 || SystemError
|-
| 2 || ApplicationError
|-
| 3 || Eula
|-
| 4 || ParentalControl
|-
| 5 || RecordedSystemData
|-
| 6 || RecordedSystemError
|-
| 7 || RecordedApplicationError
|-
| 8 || SystemUpdateEula
|}
 
= ErrorViewerJumpDestination =
This is "nn::err::ErrorViewerJumpDestination".
 
{| class="wikitable" border="1"
|-
! Value
! Description
|-
| 0 || Nowhere
|-
| 1 || Set_SystemUpdate
|-
| 2 || Set_DataManagement
|-
| 3 || Set_InternetSetting
|-
| 4 || Cabinet_NfpDataSetting
|}
 
= ErrorCode =
This is "nn::err::ErrorCode". This is an u64.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || [[#ErrorCodeCategory|Category]]
|-
| 0x4 || 0x4 || [[#ErrorCodeNumber|Number]]
|}
 
= ErrorCodeCategory =
This is "nn::err::ErrorCodeCategory". This is an u32.
 
= ErrorCodeNumber =
This is "nn::err::ErrorCodeNumber". This is an u32.
 
= ApplicationErrorCodeNumber =
This is "nn::err::ApplicationErrorCodeNumber". This is an u32.
 
= EulaData =
This is "nn::err::EulaData". This is a 0x20000-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || DataCount
|-
| 0x4 || 0x3C || Reserved
|-
| 0x40 || 0x4 || [[Settings_services#Language|Language]]
|-
| 0x44 || 0x4 || Reserved
|-
| 0x48 || 0x8 || Size
|-
| 0x50 || 0x1FFB0 || Body
|}
 
= ResultBacktrace =
This is "nn::err::ResultBacktrace". This is a 0x84-byte struct.
 
{| class="wikitable" border="1"
|-
! Offset || Size || Description
|-
| 0x0 || 0x4 || Count
|-
| 0x4 || 0x4 * 32 || Array of Result
|}
 
= Usage =
User-processes should push a common arguments struct (version=0) as well as the Arg struct. Once the applet finishes running successfully, it may return an output storage in some cases. An u8 status value is located at +1, where non-zero indicates error.


[[Category:Library Applets]]
[[Category:Library Applets]]