Errors on the CTR system can be broadly classified into the following categories:
A fatal error is an error due to a hardware bug or other error that should not arise in the retail product. The system cannot recover from such an error and there is no means of error handling.
As a general rule, when an error of this type arises, the error is not passed over to the application but instead the system stops and FATAL ERROR is displayed on the screen. Users who encounter this displayed error should check the manual as instructed by the message and, if the problem cannot be resolved, ultimately contact Customer Support.
If error display on the system is not possible, just stop the system.
It's possible to recover from the following types of errors.
If any of these types of errors are encountered, have the application conduct the pertinent error handling to try to recover, and if necessary use the error display applet to inform the user that an error has occurred. In principle, the application can continue to operate.
Many SDK interfaces will return an instance of the nn::Result class when an error may be returned. For details, see the Result class.
To learn details about the error handling by each library, read the references for those libraries.
When a fatal error occurs, the system normally responds internally so there is no need to return an error to the application. That being said, if the same state occurs during application processing, you can use the following macro to output a FATAL ERROR screen like the one displayed by the system.
#include <nn/err.h>
NN_ERR_THROW_FATAL(result);
When a Result type argument is given for this macro, if the result is fatal (LEVEL_FATAL) or one not expected to occur in the final retail product (like LEVEL_USAGE or LEVEL_PERMANENT), the process transitions to the display of the FATAL ERROR screen.
NN_ERR_THROW_FATAL_IF_FATAL_ONLY(result);
If you use the code above, the FATAL ERROR screen is displayed only if the Result is LEVEL_FATAL.
NN_ERR_THROW_FATAL_ALL(result);
If you use the code above, the FATAL ERROR screen is displayed whenever the Result does not indicate success (LEVEL_SUCCESS).(Do not use this macro unless it is specified in the recommended error handling sequence for an individual library.)
The FATAL ERROR screen displays a message for the end user on the Touch Screen and, on test units only, displays detailed error information on the 3D Screen. In either case, the system stops and does not respond to any user operation except powering it off.
Although using these macros from the application is not a problem in and of itself, be aware that the displayed FATAL ERROR screen is normally expected to be tied to issues involving Customer Support. Do not use these macros to handle errors that can occur normally as the result of the execution environment and user operations.
A wide variety of errors can occur and be returned by the system, depending on such factors as the authority to access different media and different files.
In certain cases such as when the save data is corrupted, the error handling must even include application sequences.
For this reason, the processing methods for errors returned by the system are different from those of the other libraries. For details, see the File System documentation.
NN_ERR_THROW_FATAL_IF_FATAL_ONLY and NN_ERR_THROW_FATAL_ALL and revised some other explanations.CONFIDENTIAL