1<?xml version="1.0" encoding="utf-8"?> 2<html xml:lang="en-US" lang="en-US"> 3<head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../css/page.css" type="text/css" /> 7<title>Error Handling</title> 8</head> 9<body> 10<h1>Error Handling</h1> 11<h2>Overview</h2> 12 <p> 13Errors on the CTR system can be broadly classified into the following categories: 14 </p> 15<h3> Unsustainable Fatal Errors </h3> 16 <p> 17A <I>fatal error</I> 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. 18 </p> 19 <p> 20As 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. 21 </p> 22 <p> 23If error display on the system is not possible, just stop the system. 24 </p> 25<h3> Recoverable Errors </h3> 26 <p> 27It's possible to recover from the following types of errors. 28 </p> 29 30 <ul> 31<li>Incorrect settings</li> 32<li>Communication errors</li> 33<li>File capacity exceeded or insufficient free space</li> 34<li>Corrupted save data </li> 35<li>Software inconsistency (recoverable by reinitializing and other means)</li> 36<li>A fatal error that allows the system to continue to run (such as a broken camera)</li> 37 </ul> 38 39 <p> 40If 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. 41 </p> 42 43<h2> Error Handling </h2> 44 45 <p> 46Many SDK interfaces will return an instance of the <CODE>nn::Result</CODE> class when an error may be returned. For details, see the <CODE><a href="../nn/Result/Overview.html">Result</a></CODE> class. 47 </p> 48 49 <p> 50To learn details about the error handling by each library, read the references for those libraries. 51 </p> 52 53<h3> Handling of Fatal Errors </h3> 54 55 <p> 56When 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. 57 </p> 58 59 <pre><code> 60 #include <nn/err.h> 61 62 NN_ERR_THROW_FATAL(result); 63 </code></pre> 64 65 <p> 66When a <span class="argument">Result</span> type argument is given for this macro, if the result is fatal (<CODE>LEVEL_FATAL</CODE>) or one not expected to occur in the final retail product (like <CODE>LEVEL_USAGE</CODE> or <CODE>LEVEL_PERMANENT</CODE>), the process transitions to the display of the FATAL ERROR screen. 67 </p> 68 <pre><code> 69 NN_ERR_THROW_FATAL_IF_FATAL_ONLY(result); 70 </code></pre> 71 <p> 72If you use the code above, the FATAL ERROR screen is displayed only if the <CODE>Result</CODE> is <CODE>LEVEL_FATAL</CODE>. 73 </p> 74 <pre><code> 75 NN_ERR_THROW_FATAL_ALL(result); 76 </code></pre> 77 <p> 78If you use the code above, the FATAL ERROR screen is displayed whenever the <CODE>Result</CODE> does not indicate success (<CODE>LEVEL_SUCCESS</CODE>).<strong>(Do not use this macro unless it is specified in the recommended error handling sequence for an individual library.)</strong> 79 </p> 80 <p> 81The FATAL ERROR screen displays a message for the end user on the Touch Screen and, on test units <I>only</I>, 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. 82 </p> 83 <p> 84Although 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. 85 </p> 86 87<h3> Error Handling Relating to File Operations </h3> 88 89 <p> 90A 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. 91 </p> 92 93 <p> 94In certain cases such as when the save data is corrupted, the error handling must even include application sequences. 95 </p> 96 97 <p> 98For 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. 99 </p> 100 101<h2>Revision History</h2> 102 <div class="section"> 103 <dl class="history"> 104 <dt>2011/03/01</dt> 105 <dd>Added descriptions of <CODE>NN_ERR_THROW_FATAL_IF_FATAL_ONLY</CODE> and <CODE>NN_ERR_THROW_FATAL_ALL</CODE> and revised some other explanations.</dd> 106 <dt>2010/10/27</dt> 107 <dd>Initial version.</dd> 108 </dl> 109 </div> 110<hr><p>CONFIDENTIAL</p></body> 111</html> 112