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 12<h2>Overview</h2> 13 14 <p> 15Errors on the CTR system can be broadly classified into the following categories: 16 </p> 17 18<h3> Unsustainable Fatal Errors </h3> 19 20 <p> 21A <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. 22 </p> 23 <p> 24As 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 error display should check the manual and, if the problem cannot be resolved, contact User Support as a last resort. 25 </p> 26 <p> 27If error display on the system is not possible, just stop the system. 28 </p> 29 30<h3> Recoverable Errors </h3> 31 32 <p> 33It's possible to recover from the following types of errors. 34 </p> 35 36 <ul> 37<li>Incorrect settings</li> 38<li>Communication errors</li> 39<li>File capacity exceeded or insufficient free space</li> 40<li>Corrupted save data </li> 41<li>Software inconsistency (recoverable by reinitializing and other means)</li> 42<li>A fatal error that allows the system to continue to run (such as a broken camera)</li> 43 </ul> 44 45 <p> 46If 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. 47 </p> 48 49<h2> Error Handling </h2> 50 51 <p> 52The SDK interface returns an instance of the <CODE>nn::Result</CODE> class when it is possible to return an error. For details, see the <CODE><a href="../nn/Result/Overview.html">Result</a></CODE> class. 53 </p> 54 55 <p> 56To learn details about the error handling by each library, read the references for those libraries. 57 </p> 58 59<h3> Handling of Fatal Errors </h3> 60 61 <p> 62When a fatal error occurs, the system normally responds internally so there is no need to return an error to the application. That being said, when the same state occurs in the application's processing, you can use the following macro to output the FATAL ERROR screen like that displayed by the system. 63 </p> 64 65 <pre><code> 66 #include <nn/err.h> 67 68 NN_ERR_THROW_FATAL(result); 69 </code></pre> 70 71 <p> 72When 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. For errors on the development hardware, detailed information is displayed on the screen. For errors on the retail product, only messages for users are shown on the screen. In either case, the system stops and can no longer be operated. 73 </p> 74 <p> 75Using this macro from the application is not a problem in and of itself, but be aware that this can lead users to contact User Support. 76 </p> 77 78<h3> Error Handling Relating to File Operations </h3> 79 80 <p> 81A 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. 82 </p> 83 84 <p> 85In certain cases such as when the save data is corrupted, the error handling must even include application sequences. 86 </p> 87 88 <p> 89For 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. 90 </p> 91 92<h2>Revision History</h2> 93 <div class="section"> 94 <dl class="history"> 95 <dt>2010/10/27</dt> 96 <dd>Initial version.</dd> 97 </dl> 98 </div> 99 100<hr><p>CONFIDENTIAL</p></body> 101</html> 102