mirror of
https://github.com/thunderbrewhq/squall.git
synced 2025-12-12 02:22:30 +00:00
feat(error): add SErrDisplayErrorFmt
This commit is contained in:
parent
ba016168b6
commit
a47059bd90
2 changed files with 14 additions and 0 deletions
|
|
@ -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) {
|
void SErrPrepareAppFatal(const char* filename, int32_t linenumber) {
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,8 @@
|
||||||
|
|
||||||
int32_t SErrDisplayError(uint32_t errorcode, const char* filename, int32_t linenumber, const char* description, int32_t recoverable, uint32_t exitcode, uint32_t a7);
|
int32_t SErrDisplayError(uint32_t errorcode, const char* filename, int32_t linenumber, const char* description, int32_t recoverable, uint32_t exitcode, uint32_t a7);
|
||||||
|
|
||||||
|
int32_t SErrDisplayErrorFmt(uint32_t errorcode, const char* filename, int32_t linenumber, int32_t recoverable, uint32_t exitcode, const char* format, ...);
|
||||||
|
|
||||||
void SErrPrepareAppFatal(const char* filename, int32_t linenumber);
|
void SErrPrepareAppFatal(const char* filename, int32_t linenumber);
|
||||||
|
|
||||||
void SErrSetLastError(uint32_t errorcode);
|
void SErrSetLastError(uint32_t errorcode);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue