aboutsummaryrefslogtreecommitdiff
path: root/src/common/Debugging/Errors.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2015-11-13 22:43:36 +0100
committerShauren <shauren.trinity@gmail.com>2015-11-13 22:43:36 +0100
commitd31706b07e5e4a4d632f5deea7076e864b467bbe (patch)
tree72a98671ee028953223e6034d4704deb2996a39a /src/common/Debugging/Errors.cpp
parent17a5f51a29040d6f178bdc8a1a3fac4c6fa8c026 (diff)
Core/DBLayer: Improve error message from 0a27f8bce264b8f6d8c55efa8ebc97f6e9cb7d11
Diffstat (limited to 'src/common/Debugging/Errors.cpp')
-rw-r--r--src/common/Debugging/Errors.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/common/Debugging/Errors.cpp b/src/common/Debugging/Errors.cpp
index 6c295a993f5..2406493442d 100644
--- a/src/common/Debugging/Errors.cpp
+++ b/src/common/Debugging/Errors.cpp
@@ -59,10 +59,15 @@ void Assert(char const* file, int line, char const* function, char const* messag
exit(1);
}
-void Fatal(char const* file, int line, char const* function, char const* message)
+void Fatal(char const* file, int line, char const* function, char const* message, ...)
{
- fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n",
- file, line, function, message);
+ va_list args;
+ va_start(args, message);
+
+ fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n ", file, line, function);
+ vfprintf(stderr, message, args);
+ fprintf(stderr, "\n");
+ fflush(stderr);
std::this_thread::sleep_for(std::chrono::seconds(10));
*((volatile int*)NULL) = 0;