From aaa19c9dcaed6e859d6565b8c1bfb07f755f0d7e Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 8 Apr 2015 14:57:47 -0400 Subject: [PATCH] Make Assert() throw an exception too. --- src/mlpack/core/util/log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mlpack/core/util/log.cpp b/src/mlpack/core/util/log.cpp index c532a557c2..2ff9cf84ad 100644 --- a/src/mlpack/core/util/log.cpp +++ b/src/mlpack/core/util/log.cpp @@ -125,7 +125,7 @@ void Log::Assert(bool condition, const std::string& message) free(messages); #endif - exit(1); + throw std::runtime_error("Log::Assert() failed:" + message); } } #else