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(); }
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)); } }
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); }
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); }
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); }
std::string GetLastErrorStr() { if (nlGetError() != NL_SYSTEM_ERROR) return std::string(nlGetErrorStr(nlGetError())); else return std::string(nlGetSystemErrorStr(nlGetSystemError())); }