DWC_GetLastError*

Syntax

#include <dwc.h>

DWCError DWC_GetLastError( int* errorCode );

DWCError DWC_GetLastErrorEx( int* errorCode, DWCErrorType* errorType );

Description

Gets information about the last communication error. If this goes into an error status, the DWC library stops accepting most 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 on the screen. However, if the error code is 0 or the error process type is DWC_ETYPE_LIGHT, these are game-specific displays and displaying the error code is unnecessary.

We recommend that you use the DWC_GetLastErrorEx function, which also obtains the error process type (errorType) at the same time. errorType stores information about the recovery process after an error occurs, and information for displaying the error code, allowing a fixed error process to be created for each value.

Arguments

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

Error Codes (errorCode)

Table of Contents

Error codes related to the GameSpy SDK (-60000 to -99999)
Error codes for the download feature (-31000 to -31999)
Error codes related to checking for illegal character strings (-33000 to -33999)
Error codes for the authentication server (-20000 to -29999)
Error codes for Internet connectivity (-50000 to -59999)


Error codes related to the GameSpy SDK (-60000 to -99999)

Error codes related to the GameSpy SDK (the library that uses GameSpy server features) are expressed by adding the following three values:
[Sequence where the error occurred] + [GameSpy SDK type where the error occurred] + [Detailed error information].
When the FriendsMatch Library is not used, the errors associated with the GameSpy SDK will not occur.

The sequence where 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 that is not listed.
GameSpySDK errors
DWC_ECODE_GS_GP -1000 GameSpy GP error
DWC_ECODE_GS_PERS -2000 GameSpy Persistent error.
DWC_ECODE_GS_STATS -3000 GameSpy Stats error.
DWC_ECODE_GS_QR2 -4000 GameSpy QR2 error.
DWC_ECODE_GS_SB -5000 GameSpy ServerBrowsing error.
DWC_ECODE_GS_NN -6000 GameSpy NatNegotiation error.
DWC_ECODE_GS_GT2 -7000 GameSpy gt2 error.
DWC_ECODE_GS_HTTP -8000 GameSpy HTTP 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 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 negotiations for the specified number of times.
DWC_ECODE_TYPE_SC_CL_FAIL -430 The server-client matchmaking client DS failed to connect.
DWC_ECODE_TYPE_CLOSE -600 Closing connections 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 reception buffer overflows.
DWC_ECODE_TYPE_TRANS_SEND -630 Reliable transfer failure
DWC_ECODE_TYPE_TRANS_UNKNOWN_PEER -640 Error during reception from unknown peer
DWC_ECODE_TYPE_AC_FATAL -700 The error group on AC during the automatic connection process. In this case, the lower order digits represent a dedicated state value.
DWC_ECODE_TYPE_OPEN_FILE -800 Failed to open GHTTP file.
DWC_ECODE_TYPE_INVALID_POST -810 Invalid GHTTP transmission.
DWC_ECODE_TYPE_REQ_INVALID -820 GHTTP file names and so on are invalid.
DWC_ECODE_TYPE_UNSPECIFIED -830 Unspecified GHTTP error.
DWC_ECODE_TYPE_BUFF_OVER -840 GHTTP buffer overflow.
DWC_ECODE_TYPE_PARSE_URL -850 GHTTPURL analysis error.
DWC_ECODE_TYPE_BAD_RESPONSE -860 Error analyzing the response from the GHTTP server.
DWC_ECODE_TYPE_REJECTED -870 Reject requests and so on from a GHTTP server.
DWC_ECODE_TYPE_FILE_RW -880 GHTTP local file read/write error.
DWC_ECODE_TYPE_INCOMPLETE -890 GHTTP download aborted.
DWC_ECODE_TYPE_TO_BIG -900 Download prohibited because the GHTTP file size is too large.
DWC_ECODE_TYPE_ENCRYPTION -910 GHTTP encryption error.
DWC_ECODE_TYPE_ALLOC -1 Failed to allocate memory.
DWC_ECODE_TYPE_PARAM -2 Parameter error.
DWC_ECODE_TYPE_SO_SOCKET -3 A GameSpy gt2 socket error was 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 adding the following three values:
DWC_ECODE_SEQ_ADDINS(-30000) + DWC_ECODE_FUNC_ND(-1000) + (the error details).

Detailed error information
DWC_ECODE_TYPE_ND_ALLOC -1 Failed to allocate memory.
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_FATAL -9 Some other fatal error (not defined above) has occurred.
(Undefined) -101 Illegal parameter.
(Undefined) -102 Unregistered service.
(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 feature that checks for illegal strings (-33000 to -33999)

The error codes related to the feature that checks for illegal strings are expressed by adding 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 errors codes are related to logging onto the authentication server and getting the service locator information.

Error codes related to connecting to the Internet (-50000 to -59999)

The error codes related to connecting to the Internet are expressed by adding the following two values:
[Detailed error information] + [connection target (access point) 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.
-51099 Found the access point beacon but not the SSID that would match that of the connection candidate. Connection target type is 99.
-51100 Could not connect to access point because WEP key is different.
Note: The status code for an authentication request is 15: Authentication rejected due to challenge failure (WEP key error).
Example for the connection target type 03: the PC was not set to permit connections; thus, it could not connect to Nintendo Wi-Fi Connection.
-51200 Could not connect to the access point because the maximum connectable number of units was exceeded.
Note: The status code for an association request is 17: Connection rejected due to lack of resources at access point resource.
-51300 Found the access point beacon but not the SSID that would match that of the connection candidate. Connection target type is 99.
-52000 DHCP failed.
-52100 DNS failed (throughout the entire process of automatic connection to the Internet).
-52200 Could not connect to the server for HTTP connection tests on the Internet.
-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).
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 free hotspot.
-6 A Wayport connection (hotspot in North America).
-7 (Reserved)
-8 Nintendo Spot (for use in Japan only)

Error Process Type (errorType)

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

DWC_ETYPE_NO_ERROR No error.
DWC_ETYPE_LIGHT Only a game-specific display; error code display is not necessary.
To make recovery possible, call the DWC_ClearError function.
DWC_ETYPE_SHOW_ERROR Display the error code.
To make recovery possible, call 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.
The DWC_ShutdownGHTTP function (HTTP communication library)
The DWC_RnkShutdown function (general 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_ShutdownGHTTP function (HTTP communications library)
DWC_NdCleanupAsync function (Download library)
DWC_RnkShutdown function (general-purpose ranking library)*
Communication must also be terminated later using DWC_CleanupInet or DWC_CleanupInetAsync. Display the error code.
DWC_ETYPE_FATAL Since this is equivalent to a FatalError, it is necessary to prompt the user to turn power OFF. Display the error code.

* Because the general ranking library uses the HTTP communication library, the DWC_InitGHTTP and DWC_ShutdownGHTTP functions will be called from inside the general ranking library's initialization/close process.

Return Values

DWC_ERROR_NONE No error.
DWC_ERROR_DS_MEMORY_ANY Error related to system save data.
DWC_ERROR_AUTH_ANY Authentication-related error.
DWC_ERROR_AUTH_OUT_OF_SERVICE Service terminated.
DWC_ERROR_AUTH_STOP_SERVICE Service being halted temporarily.
DWC_ERROR_AC_ANY Error related to automatic connection.
DWC_ERROR_NETWORK Other network error.
DWC_ERROR_DISCONNECTED Disconnected.
DWC_ERROR_FATAL Fatal error.
DWC_ERROR_FRIENDS_SHORTAGE Tried to begin matchmaking by specifying friends without enough valid friends for the specified number.
DWC_ERROR_NOT_FRIEND_SERVER With server-client matchmaking, either the friends specified in the server DS are not mutual friends or the server is down.
DWC_ERROR_MO_SC_CONNECT_BLOCK The server DS has denied the connection based on the matchmaking options in server-client matchmaking.
DWC_ERROR_SERVER_FULL The server-client matchmaking server DS has exceeded the maximum number of participants.
DWC_ERROR_GHTTP_ANY HTTP communications (GameSpy HTTP) error.
DWC_ERROR_ND_HTTP Download library HTTP communications error.
DWC_ERROR_ND_ANY Some other error by the download library.
DWC_ERROR_SVL_HTTP HTTP communications error occured while service locator information is being obtained.
DWC_ERROR_SVL_ANY Some other error occured while service locator information is being obtained.
DWC_ERROR_PROF_HTTP HTTP communications error by the Illegal Character String Check library.
DWC_ERROR_PROF_ANY Some other error by the Illegal Character String Check library

See Also

DWC_ClearError, DWC_ShutdownFriendsMatch, DWC_InitGHTTP, DWC_ShutdownGHTTP, DWC_NdCleanupAsync

Revision History

2008/03/02 Added -630 and -640
2007/01/10 Revised the information for 50000 series error codes.
2007/12/10 Added the 50000 series error codes.
2007/04/09 Added error information for the Illegal Character String Check feature.
2006/10/06 Added an explanation for the error process type DWC_ETYPE_SHUTDOWN_GHTTP.
2006/08/02 Changed the error display conditions from "Display All" to "OK not to display when the error code is 0".
2006/07/24 Corrected errors.
2006/07/03 Inserted an explanation for cases where the FriendsMatch Library is not in use.
2006/06/22 Added error code -31030.
2006/06/14 Changed the error display conditions from "OK not to display when the error is 0 to -9999" to "Display all".
2005/06/05 Combined function references for DWC_GetLastError
and DWC_GetLastErrorEx.
2005/05/26 Added error information for Download and other features.

Revision history for the DWC_GetLastError function.
2005/12/16 Revisions.
2005/07/22 Initial version.

Revision history for the DWC_GetLastErrorEx function.
2005/01/31 Set up a link to the FriendsMatch Library
2005/12/16 Revisions.
2005/11/01 Initial version.


CONFIDENTIAL