diff --git a/src/Nazara/Core/Error.cpp b/src/Nazara/Core/Error.cpp index 42a297076..921fff968 100644 --- a/src/Nazara/Core/Error.cpp +++ b/src/Nazara/Core/Error.cpp @@ -17,7 +17,7 @@ void NzError::Error(nzErrorType type, const NzString& error) { - if ((s_flags & nzErrorFlag_Silent) == 0 || (s_flags & nzErrorFlag_SilentDisabled) != 0) + if (type == nzErrorType_AssertFailed || (s_flags & nzErrorFlag_Silent) == 0 || (s_flags & nzErrorFlag_SilentDisabled) != 0) NazaraLog->WriteError(type, error); s_lastError = error; @@ -27,16 +27,17 @@ void NzError::Error(nzErrorType type, const NzString& error) #if NAZARA_CORE_EXIT_ON_ASSERT_FAILURE if (type == nzErrorType_AssertFailed) - std::exit(EXIT_FAILURE); + std::abort(); #endif - if (type != nzErrorType_Warning && (s_flags & nzErrorFlag_ThrowException) != 0 && (s_flags & nzErrorFlag_ThrowExceptionDisabled) == 0) + if (type == nzErrorType_AssertFailed || (type != nzErrorType_Warning && + (s_flags & nzErrorFlag_ThrowException) != 0 && (s_flags & nzErrorFlag_ThrowExceptionDisabled) == 0)) throw std::runtime_error(error); } void NzError::Error(nzErrorType type, const NzString& error, unsigned int line, const char* file, const char* function) { - if ((s_flags & nzErrorFlag_Silent) == 0 || (s_flags & nzErrorFlag_SilentDisabled) != 0) + if (type == nzErrorType_AssertFailed || (s_flags & nzErrorFlag_Silent) == 0 || (s_flags & nzErrorFlag_SilentDisabled) != 0) NazaraLog->WriteError(type, error, line, file, function); s_lastError = error; @@ -44,13 +45,14 @@ void NzError::Error(nzErrorType type, const NzString& error, unsigned int line, s_lastErrorFunction = function; s_lastErrorLine = line; - if (type != nzErrorType_Warning && (s_flags & nzErrorFlag_ThrowException) != 0 && (s_flags & nzErrorFlag_ThrowExceptionDisabled) == 0) - throw std::runtime_error(error); - #if NAZARA_CORE_EXIT_ON_ASSERT_FAILURE if (type == nzErrorType_AssertFailed) - std::exit(EXIT_FAILURE); + std::abort(); #endif + + if (type == nzErrorType_AssertFailed || (type != nzErrorType_Warning && + (s_flags & nzErrorFlag_ThrowException) != 0 && (s_flags & nzErrorFlag_ThrowExceptionDisabled) == 0)) + throw std::runtime_error(error); } nzUInt32 NzError::GetFlags()