Exemplo n.º 1
0
std::string LowLevelError::toString() const {
  std::ostringstream ret;
  ret << Error::toString();

  if (hawkError != NL_NO_ERROR && hawkError != NL_SOCKET_ERROR)
    ret << " HawkNL error " << hawkError << ": " << nlGetErrorStr(hawkError);
  if (sysError != 0)
    ret << " System error " << sysError << ": " << nlGetSystemErrorStr(sysError);
  
  return ret.str();
}
Exemplo n.º 2
0
static void printError(void)
{
    NLenum err = nlGetError();

    if(err == NL_SYSTEM_ERROR)
    {
        _tprintf(TEXT("System error: %s\n"), nlGetSystemErrorStr(nlGetSystemError()));
    }
    else
    {
        _tprintf(TEXT("HawkNL error: %s\n"), nlGetErrorStr(err));
    }
}
Exemplo n.º 3
0
void printErrorExit(void)
{
    NLenum err = nlGetError();

    if(err == NL_SYSTEM_ERROR)
    {
        printf("System error: %s\n", nlGetSystemErrorStr(nlGetSystemError()));
    }
    else
    {
        printf("HawkNL error: %s\n", nlGetErrorStr(err));
    }
    nlShutdown();
    exit(1);
}
Exemplo n.º 4
0
static void printErrorExit(void)
{
    NLenum err = nlGetError();

    if(err == NL_SYSTEM_ERROR)
    {
        _tprintf(TEXT("System error: %s\n"), nlGetSystemErrorStr(nlGetSystemError()));
    }
    else
    {
        _tprintf(TEXT("HawkNL error: %s\n"), nlGetErrorStr(err));
    }
    nlShutdown();
    exit(EXIT_FAILURE);
}
Exemplo n.º 5
0
static void printErrorExit(void)
{
    NLenum err = nlGetError();

    if(err == NL_SYSTEM_ERROR)
    {
        NLint e = nlGetSystemError();

        printf("System error: %s\n", nlGetSystemErrorStr(e));
    }
    else
    {
        printf("HawkNL error # %d: %s\n", err, nlGetErrorStr(err));
    }
    nlShutdown();
    exit(EXIT_FAILURE);
}
Exemplo n.º 6
0
std::string GetLastErrorStr()  {
	if (nlGetError() != NL_SYSTEM_ERROR)
		return std::string(nlGetErrorStr(nlGetError()));
	else
		return std::string(nlGetSystemErrorStr(nlGetSystemError()));
}