MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fxVReportError

Function fxVReportError

xs/sources/xsDebug.c:2993–3023  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2991}
2992
2993void fxVReportError(void* console, txString thePath, txInteger theLine, txString theFormat, c_va_list theArguments)
2994{
2995#ifdef mxDebug
2996 txMachine* the = console;
2997 if (fxIsConnected(the)) {
2998 fxEchoStart(the);
2999 fxEcho(the, "<log");
3000 fxEchoPathLine(the, thePath, theLine);
3001 fxEcho(the, "># Error: ");
3002 fxEchoFormat(the, theFormat, theArguments);
3003 fxEcho(the, "!\n</log>");
3004 fxEchoStop(the);
3005 }
3006#elif defined(nrf52) && defined(mxInstrument)
3007 char buf[256];
3008 if (thePath && theLine)
3009 c_snprintf(buf, 256, "%s:%d: error: ", thePath, (int)theLine);
3010 else
3011 c_snprintf(buf, 256, "# error: ");
3012 modLog_transmit(buf);
3013 c_snprintf(buf, 256, theFormat, theArguments);
3014 modLog_transmit(buf);
3015#elif defined(DEBUG_EFM)
3016 if (thePath && theLine)
3017 sprintf(_debugStrBuffer, "%s:%d: error: ", thePath, (int)theLine);
3018 else
3019 sprintf(_debugStrBuffer, "# error: ");
3020 vsprintf(_debugStrBuffer, theFormat, theArguments);
3021 _debugStrBuffer[255] = '\0';
3022#endif
3023}
3024
3025void fxVReportWarning(void* console, txString thePath, txInteger theLine, txString theFormat, c_va_list theArguments)
3026{

Callers 1

fxReportErrorFunction · 0.70

Calls 6

fxEchoStartFunction · 0.85
fxEchoFunction · 0.85
fxEchoPathLineFunction · 0.85
fxEchoFormatFunction · 0.85
fxEchoStopFunction · 0.85
fxIsConnectedFunction · 0.70

Tested by

no test coverage detected