TegraExplorer/source/script/scriptError.c

21 lines
578 B
C
Raw Permalink Normal View History

2021-07-09 22:56:13 +02:00
#include "scriptError.h"
#include "compat.h"
#include <stdarg.h>
2024-06-22 13:22:21 +02:00
#include "../hid/hid.h"
2021-07-09 22:56:13 +02:00
s64 scriptCurrentLine;
2021-07-10 14:45:09 +02:00
u8 scriptLastError = 0;
2021-07-09 22:56:13 +02:00
void printScriptError(u8 errLevel, char* message, ...) {
va_list args;
2021-07-10 14:45:09 +02:00
scriptLastError = errLevel;
2021-07-09 22:56:13 +02:00
va_start(args, message);
gfx_printf("\n\n[%s] ", (errLevel == SCRIPT_FATAL) ? "FATAL" : (errLevel == SCRIPT_PARSER_FATAL) ? "PARSE_FATAL" : "WARN");
gfx_vprintf(message, args);
if (errLevel < SCRIPT_WARN)
2021-07-22 17:23:59 +02:00
gfx_printf("\nError occured on or near line %d\n", (u32)scriptCurrentLine);
2021-07-09 22:56:13 +02:00
va_end(args);
2021-07-28 00:46:39 +02:00
#ifndef WIN32
hidWait();
#endif
2021-07-09 22:56:13 +02:00
}