DWC_GetLastErrorEx

Syntax

#include <dwc.h>
DWCError DWC_GetLastErrorEx(int *errorCode,
                            DWCErrorType *errorType);

Arguments

errorCode Pointer to the error code storage location. If retrieval is not required, specify NULL.
errorType Pointer to location where the error processing type is stored. If retrieval is not required, specify NULL.

Return Values

Description
Corresponding error handling type
DWC_ERROR_NONENo error. DWC_ETYPE_NO_ERROR
DWC_ERROR_FRIENDS_SHORTAGETried to begin friend-specified matchmaking without enough valid friends for the specified number. DWC_ETYPE_LIGHT
DWC_ERROR_NOT_FRIEND_SERVERWith server-client matchmaking, either the friends specified to the server DS are not mutual friends or the server is down. DWC_ETYPE_LIGHT
DWC_ERROR_SC_CONNECT_BLOCKThe server denied client connection during server-client matchmaking. DWC_ETYPE_LIGHT
DWC_ERROR_SERVER_FULLThe server-client matchmaking server DS has exceeded the maximum number of participants. DWC_ETYPE_LIGHT
DWC_ERROR_SVL_ANYSome other error occurred while service locator information was being obtained. DWC_ETYPE_SHOW_ERROR
DWC_ERROR_PROF_ANYSome other error by the Illegal String Check library. DWC_ETYPE_SHOW_ERROR
DWC_ERROR_GDB_ANYGDB library error. Normally does not occur with DWC. DWC_ETYPE_SHOW_ERROR
DWC_ERROR_NETWORKOther network error. DWC_ETYPE_SHUTDOWN_FM
DWC_ERROR_GHTTP_ANYHTTP communications (GameSpy HTTP) error. DWC_ETYPE_SHUTDOWN_GHTTP
DWC_ERROR_ND_ANYSome other error by the Download library. DWC_ETYPE_SHUTDOWN_ND
DWC_ERROR_AUTH_ANYAuthentication-related error. DWC_ETYPE_DISCONNECT
DWC_ERROR_AUTH_OUT_OF_SERVICEService terminated. DWC_ETYPE_DISCONNECT
DWC_ERROR_AUTH_STOP_SERVICEService being halted temporarily. DWC_ETYPE_DISCONNECT
DWC_ERROR_AC_ANYError related to automatic connection. DWC_ETYPE_DISCONNECT
DWC_ERROR_DISCONNECTEDDisconnected. DWC_ETYPE_DISCONNECT
DWC_ERROR_ND_HTTPDownload library HTTP communications error. DWC_ETYPE_DISCONNECT
DWC_ERROR_SVL_HTTPHTTP communications error occurred while service locator information was being obtained. DWC_ETYPE_DISCONNECT
DWC_ERROR_PROF_HTTPHTTP communications error by the Illegal String Check library. DWC_ETYPE_DISCONNECT
DWC_ERROR_DS_MEMORY_ANYError related to system save data. DWC_ETYPE_FATAL
DWC_ERROR_FATALFatal error. DWC_ETYPE_FATAL

Description

Gets information about the most recent communication error. If the system enters error status, the DWC library stops accepting nearly all functions. To recover from an error status, call the DWC_ClearError function after executing the appropriate error handling process.

The error code that should be displayed when the application generates an error is returned to the buffer indicated by the pointer to the error code storage destination. Because the error code is returned as a negative value, invert the sign to make it positive before displaying it onscreen. However, if the error code is 0 or the error process type is DWC_ETYPE_LIGHT, only the game-specific display is required, and the error code does not need to be displayed.

The errorType argument stores information about the recovery process required after an error occurs and information for displaying the error code, allowing a standard error process to be created for each value.

Error Codes (errorCode)

For more information on error codes, see the DS Network Error Code List supplied separately.

Table of Contents

GameSpySDK-related (-60000 to -99999)
Download features-related (-31000 to -31999)
Illegal string check-related (-33000 to -33999)
Authentication server-related (-20000 to -29999)
Internet connection-related (-50000 to -59999)


Error Codes Related to the GameSpy SDK (-60000 to -99999)

Error codes related to the GameSpy SDK (the library that uses the GameSpy server features) are expressed by summing the following three values.
[Sequence in which error processing occurred] + [Type of GameSpy SDK that generated the error] + [Detailed error information].
When the FriendsMatch library is not used, errors related to the GameSpy SDK will not occur.

Sequence In Which Error Processing Occurred
DWC_ECODE_SEQ_LOGIN-60000 Error during login processing.
DWC_ECODE_SEQ_FRIEND -70000 Error during friend management processing.
DWC_ECODE_SEQ_MATCH -80000 Error during the matchmaking process.
DWC_ECODE_SEQ_ETC -90000 Error during processing other than listed above.
Type of GameSpy SDK that Generated Error
DWC_ECODE_GS_GP-1000 GameSpyGP error.
DWC_ECODE_GS_PERS -2000 GameSpyPersistent error.
DWC_ECODE_GS_STATS -3000 GameSpyStats error.
DWC_ECODE_GS_QR2 -4000 GameSpyQR2 error.
DWC_ECODE_GS_SB -5000 GameSpyServerBrowsing error.
DWC_ECODE_GS_NN -6000 GameSpyNatNegotiation error.
DWC_ECODE_GS_GT2 -7000 GameSpygt2 error.
DWC_ECODE_GS_HTTP -8000 GameSpyHTTP error.
DWC_ECODE_GS_ETC -9000 Other GameSpy SDK error.
Detailed Error Information
DWC_ECODE_TYPE_NETWORK-10 Network failure.
DWC_ECODE_TYPE_SERVER -20 GameSpy server failure.
DWC_ECODE_TYPE_DNS -30 DNS failure.
DWC_ECODE_TYPE_DATA -40 Received invalid data.
DWC_ECODE_TYPE_SOCKET -50 Socket communication error.
DWC_ECODE_TYPE_BIND -60 Socket bind error.
DWC_ECODE_TYPE_TIMEOUT -70 Timeout has occurred.
DWC_ECODE_TYPE_PEER -80 Problem with one-on-one communication.
DWC_ECODE_TYPE_CONN_OVER -100 Exceeded number of connections.
DWC_ECODE_TYPE_STATS_AUTH -200 STATS server login error.
DWC_ECODE_TYPE_STATS_LOAD -210 STATS server data load error.
DWC_ECODE_TYPE_STATS_SAVE -220 STATS server data save error.
DWC_ECODE_TYPE_NOT_FRIEND -400 The specified partner is not a mutually registered friend.
DWC_ECODE_TYPE_OTHER -410 The partner disconnected communications (usually occurs under server-client matchmaking).
DWC_ECODE_TYPE_MUCH_FAILUR -420 Failed NAT negotiation the prescribed number of times or more.
DWC_ECODE_TYPE_SC_CL_FAIL -430 Failed client connection during server-client matchmaking.
DWC_ECODE_TYPE_FAILED_SERVER_MIGRATION -431 Could not connect to a new server host after the initial server host disconnects because server migration failed or conditions did not allow server migration.
DWC_ECODE_TYPE_FAILED_CONNECT_GROUPID -432 Failed to connect by specifying the GroupID.
DWC_ECODE_TYPE_CLOSE -600 Connection close error.
DWC_ECODE_TYPE_TRANS_HEADER -610 Error which occurred when Reliable data was received in an impossible reception state.
DWC_ECODE_TYPE_TRANS_BODY -620 Error when the receive buffer has overflowed.
DWC_ECODE_TYPE_TRANS_SEND -630 Reliable send failure.
DWC_ECODE_TYPE_TRANS_UNKNOWN_PEER -640 Error during reception from unknown peer.
DWC_ECODE_TYPE_AC_FATAL -700 The error group occurring under AC during the automatic connection process. In this case, the lower order digit represents a dedicated state value.
DWC_ECODE_TYPE_OPEN_FILE -800 GameSpyHTTP file open failure.
DWC_ECODE_TYPE_INVALID_POST -810 GameSpyHTTP invalid transmission.
DWC_ECODE_TYPE_REQ_INVALID -820 GameSpyHTTP invalid file name or other invalid parameter.
DWC_ECODE_TYPE_UNSPECIFIED -830 GameSpyHTTP error whose details are unknown.
DWC_ECODE_TYPE_BUFF_OVER -840 GameSpyHTTP buffer overflow.
DWC_ECODE_TYPE_PARSE_URL -850 GameSpyHTTP URL parsing error.
DWC_ECODE_TYPE_BAD_RESPONSE -860 Error parsing the response from the GameSpyHTTP server.
DWC_ECODE_TYPE_REJECTED -870 GameSpyHTTP server rejected a request or other message.
DWC_ECODE_TYPE_FILE_RW -880 GameSpyHTTP local file read/write error.
DWC_ECODE_TYPE_INCOMPLETE -890 Incomplete GameSpyHTTP download.
DWC_ECODE_TYPE_TO_BIG -900 Unable to download because the GameSpyHTTP file size is too large.
DWC_ECODE_TYPE_ENCRYPTION -910 GameSpyHTTP encryption error.
DWC_ECODE_TYPE_ALLOC -1 Failed to allocate memory.
DWC_ECODE_TYPE_PARAM -2 Parameter error.
DWC_ECODE_TYPE_SO_SOCKET -3 GameSpygt2 socket error caused by an SO error.
DWC_ECODE_TYPE_NOT_INIT -4 The Internet connection has not been initialized.
DWC_ECODE_TYPE_DUP_INIT -5 The library has been initialized twice.
DWC_ECODE_TYPE_WM_INIT -6 Failure to initialize WM.
DWC_ECODE_TYPE_UNEXPECTED -9 An unexpected state, or an unknown GameSpy error has occurred.

Error Codes Related to the Download Feature (-31000 to -31999)

The download feature-related error codes are expressed by summing the following three values:
DWC_ECODE_SEQ_ADDINS(-30000) + DWC_ECODE_FUNC_ND(-1000) + [detailed error information].

Detailed Error Information
DWC_ECODE_TYPE_ND_ALLOC -1 Failed to allocate memory.
DWC_ECODE_TYPE_ND_FATAL -9 Some other fatal error (not defined above) has occurred.
DWC_ECODE_TYPE_ND_BUSY -10 A function was called in a state in which it cannot be called.
DWC_ECODE_TYPE_ND_HTTP -20 HTTP communications failure.
DWC_ECODE_TYPE_ND_BUFFULL -30 Received data was larger than the allocated receive buffer. (DWC_ECODE_TYPE_ND_BUFFULL is not issued starting with the TwlDWC 5.0 official release. DWC_ECODE_TYPE_ND_FATAL is set.)
DWC_ECODE_TYPE_ND_PARAM -40 Invalid parameter was passed to the function.
(Undefined) -101 Invalid parameter (for example, the game code for connecting to the download server is in the wrong format).
(Undefined) -102 Unregistered service (the specified game code for connecting is not registered in the download server).
(Undefined) -103 Illegal token (service locator information).
(Undefined) -104 Expired token (service locator information).
(Undefined) -105 No content present.
(Undefined) -106 Attribute does not match.
(Undefined) -107 Expired content.
(Undefined) -108 Access from an access point that is not a service target.
(Undefined) -109 Cannot connect to database (problem with Download server).
(Undefined) -110 Password does not match.

Error Codes Related to the Illegal String Check Feature (-33000 to -33999)

The error codes related to the illegal string check feature are expressed by summing the following three values:
DWC_ECODE_SEQ_ADDINS(-30000) + DWC_ECODE_FUNC_PROF(-3000) + [detailed error information]

Detailed Error Information
DWC_ECODE_TYPE_PROF_CONN -10 Problem with connecting to the authentication server.
DWC_ECODE_TYPE_PROF_PARSE -20 Problem with response from the authentication server.
DWC_ECODE_TYPE_PROF_OTHER -30 An error has occurred for some other reason.

Error Codes Related to the Authentication Server (-20000 to -29999)

These error codes are related to authentication server login and retrieval of service locator information.

Error Codes Related to the Internet Connection Process (-50000 to -59999)

The error codes related to connecting to the Internet are expressed by summing the following two values:
[Detailed error information] (+ [connection target type])

Detailed Error Information
-50000 Disconnected from the access point before automatic connection to the Internet could be completed. Connection target type is 00 - 98.
-50099 AP beacon could not be found. Connection target type is 99.
-50199 Network initialization failed for an unknown reason. Connection target type is 99.
-50599 Could not connect to Internet due to unobtained EULA consent. Connection target type is 99.
-50699 Could not start connection test because the wireless feature is OFF. Connection target type is 99.
-51099 Found the access point beacon, but found no SSIDs matching those of connection candidates. Connection target type is 99.
-51100 Could not connect to access point because WEP key is different.
Note: The status code for the authentication request is "15: Authentication rejected due to challenge failure (WEP key error)."
Example for connection target type 03: PC was not set to permit connections, so it could not connect to the Nintendo Wi-Fi Connector.
-51200 Could not connect to the access point because the maximum connectable number of units was exceeded.
Note: The status code for the association request is "17: Connection rejected due to lack of resources at access point."
-51300 For some reason, connection to the access point could not be established.
-52000 DHCP failed.
-52100 DNS failed (throughout the entire process of automatic connection to the Internet).
-52200 Could not connect to the Internet-based server for HTTP connection tests.
-52300 Failed to create account on the authentication server.
(For devices that have never connected to the Wi-Fi connection before, an account is created during automatic connection to the Internet.)
-53000 Could not retrieve hotspot authentication information from the authentication server.
-53100 Hotspot authentication failed.
-53200 Could not connect to the connection test server after hotspot authentication.
-54000 Disconnected from the network during communications. (Wireless connection.)
-54100 Disconnected from the network during communications. (Internet connection.)
-54900 A fatal error occurred during communication.
Connection Target Type
0 The access point for connection target 1.
-1 The access point for connection target 2.
-2 The access point for connection target 3.
-3 Nintendo Wi-Fi USB Connector.
-4 Nintendo Wi-Fi Station.
-5 A FREESPOT hotspot.
-6 Wayport (North American hotspot)
Note: Currently cannot be used.
-7 (Reserved)
-8 NintendoZone
-10 The access point for connection target 4.
-11 The access point for connection target 5.
-12 The access point for connection target 6.

Error Processing Type (errorType)

When an error occurs, the error processing type (DWCErrorType) returns a value that indicates when the library should no longer be initialized.

DWC_ETYPE_NO_ERROR No error.
DWC_ETYPE_LIGHT Only a game-specific display; error code display is not necessary.
Recovery is possible by calling the DWC_ClearError function.
DWC_ETYPE_SHOW_ERROR Display the error code.
Recovery is possible by calling the DWC_ClearError function.
DWC_ETYPE_SHUTDOWN_FM The DWC_ShutdownFriendsMatch function must be called to terminate the FriendsMatch library. Display the error code.
DWC_ETYPE_SHUTDOWN_GHTTP Call the following library release functions, as needed.
DWC_RnkShutdown function (General-Purpose Ranking library)
Display the error code.
DWC_ETYPE_SHUTDOWN_ND You must call the DWC_NdCleanupAsync function and terminate the Download library. Display the error code.
DWC_ETYPE_DISCONNECT Call the following library release functions, as needed.
DWC_ShutdownFriendsMatch function (FriendsMatch library)
DWC_NdCleanupAsync function (Download library)
DWC_RnkShutdown function (General-Purpose Ranking library).
Communication must be terminated later using the DWC_CleanupInet or DWC_CleanupInetAsync function. Display the error code.
DWC_ETYPE_FATAL Because this is equivalent to a FatalError, when using NITRO, you must prompt the user to turn power OFF. When using TWL, you must prompt the user to reset (return to the launcher). Display the error code.

See Also

DWC_ClearError
DWC_ShutdownFriendsMatch
DWC_NdCleanupAsync
DWC_GetLastError

Revision History

5.2
Removed invalid links.
5.2 PR1
Removed meaningless asterisks.
5.1
Added that Wayports (North American hotspots) cannot currently be used.
5.1 PR2
Added DWC_ERROR_NETWORK_LIGHT to the description of return values.
Added a mention of the DS Network Error Code List.

For the change log before version 5.1 PR2, click here.


CONFIDENTIAL