AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Errors.cpp File Reference

This file contains definitions of functions used for reporting critical application errors. More...

#include "Errors.h"
#include "Duration.h"
#include <cstdio>
#include <cstdlib>
#include <thread>
#include <Windows.h>

Go to the source code of this file.

Namespaces

namespace  anonymous_namespace{Errors.cpp}
 

Macros

#define Crash(message)
 

Functions

std::string GetDebugInfo ()
 
MakeMessage

Make message for display erros

Parameters
messageTypeMessage type (ASSERTION FAILED, FATAL ERROR, ERROR) end etc
filePath to file
lineLine number in file
functionFunctionn name
messageCondition to string format
fmtMessage[optional] Display format message after condition
debugInfo[optional] Display debug info
std::string anonymous_namespace{Errors.cpp}::MakeMessage (std::string_view messageType, std::string_view file, uint32 line, std::string_view function, std::string_view message, std::string_view fmtMessage={}, std::string_view debugInfo={})
 
MakeAbortMessage

Make message for display erros

Parameters
filePath to file
lineLine number in file
functionFunctionn name
fmtMessage[optional] Display format message after condition
std::string anonymous_namespace{Errors.cpp}::MakeAbortMessage (std::string_view file, uint32 line, std::string_view function, std::string_view fmtMessage={})
 

Detailed Description

This file contains definitions of functions used for reporting critical application errors.

It is very important that (std::)abort is NEVER called in place of *((volatile int*)nullptr) = 0; Calling abort() on Windows does not invoke unhandled exception filters - a mechanism used by WheatyExceptionReport to log crashes. exit(1) calls here are for static analysis tools to indicate that calling functions defined in this file terminates the application.

Definition in file Errors.cpp.

Macro Definition Documentation

◆ Crash

#define Crash (   message)
Value:
ULONG_PTR execeptionArgs[] = { reinterpret_cast<ULONG_PTR>(strdup(message)), reinterpret_cast<ULONG_PTR>(_ReturnAddress()) }; \
RaiseException(EXCEPTION_ASSERTION_FAILURE, 0, 2, execeptionArgs);
#define EXCEPTION_ASSERTION_FAILURE
Definition: Errors.h:73

Function Documentation

◆ GetDebugInfo()

std::string GetDebugInfo ( )
158{
159 return "";
160}