1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-23 04:12:04 +00:00
TegraExplorer/source/script/scriptError.c

17 lines
513 B
C
Raw Normal View History

2021-07-09 21:56:13 +01:00
#include "scriptError.h"
#include "compat.h"
#include <stdarg.h>
s64 scriptCurrentLine;
2021-07-10 13:45:09 +01:00
u8 scriptLastError = 0;
2021-07-09 21:56:13 +01:00
void printScriptError(u8 errLevel, char* message, ...) {
va_list args;
2021-07-10 13:45:09 +01:00
scriptLastError = errLevel;
2021-07-09 21:56:13 +01: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)
gfx_printf("\nError occured on or near line %d\n", scriptCurrentLine);
va_end(args);
}