feat(error): add SErrDisplayErrorFmt

This commit is contained in:
fallenoak 2020-12-08 23:37:22 -06:00
parent ba016168b6
commit a47059bd90
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D
2 changed files with 14 additions and 0 deletions

View file

@ -53,6 +53,18 @@ int32_t SErrDisplayError(uint32_t errorcode, const char* filename, int32_t linen
}
}
int32_t SErrDisplayErrorFmt(uint32_t errorcode, const char* filename, int32_t linenumber, int32_t recoverable, uint32_t exitcode, const char* format, ...) {
char buffer[2048];
va_list args;
va_start(args, format);
vsnprintf(buffer, sizeof(buffer) - 1, format, args);
buffer[sizeof(buffer) - 1] = '\0';
va_end(args);
return SErrDisplayError(errorcode, filename, linenumber, buffer, recoverable, exitcode, 1);
}
void SErrPrepareAppFatal(const char* filename, int32_t linenumber) {
// TODO
}