CTR Pia  4.11.3
Game Communication Engine
nn::pia::util::NetworkErrorCodeConverter Class Reference

This class converts nn::Result type errors into network error codes passed to the error/EULA applet. More...

+ Inheritance diagram for nn::pia::util::NetworkErrorCodeConverter:

Public Member Functions

void Trace (u64 flag) const
 Prints information that is useful for debugging. More...
 

Static Public Member Functions

static u32 Convert (const nn::Result &r)
 Converts Pia library Result values to network error codes. More...
 

Detailed Description

This class converts nn::Result type errors into network error codes passed to the error/EULA applet.


Revision History:

2015-04-16 Fixed a bug where ResultNexInternalError objects could not be converted using the Convert function after the Session::Cleanup function was called, causing the library to stop on an assertion.

2014-08-07 Changed Pia so that it halts on an assertion if something other than a Result is passed to the Convert function.

2012-11-06 Replaced locations that coded non-Pia Result values passed to Convert as immediate values with symbol names. The actual values passed remain the same.

2012-06-21 Initial version.


Revision History:
2014-11-04 Changed the operations of the Convert function.

Member Function Documentation

static u32 nn::pia::util::NetworkErrorCodeConverter::Convert ( const nn::Result &  r)
static

Converts Pia library Result values to network error codes.

Converts the Result type value returned by the Pia library to a network error code.

As an exception, returns a network error code corresponding to the NEX internal error for this Result if the ResultNexInternalError is passed. There are several types of internal error, so the return value when passed ResultNexInternalError can be undefined.

If ResultNexInternalError is passed to this function when the Pia API has not yet returned ResultNexInternalError, this function asserts. The converted values can be passed to the Error/EULA applet. If IsSuccess is true for the argument, 0 is returned. If an argument not defined in the Pia library is passed, Pia raises an assertion. (In release builds, it returns NN_PIA_ERROR_CODE_BASE.) This function converts the results defined in the Pia library into unique identification codes, with the exception of ResultNexInternalError, but it is not necessary to show all codes as errors to the user. For information about the error codes to show, For more information, see the CTR Guidelines: Internet or the network error code list.

Parameters
[in]rSpecifies the nn::Result value to convert to a network error code.
Returns
Returns the corresponding network error code.
void nn::pia::util::NetworkErrorCodeConverter::Trace ( u64  flag) const

Prints information that is useful for debugging.

Parameters
[in]flagSpecifies the bitwise OR of trace flags. For more information, see the TraceFlag type.