9 : std::runtime_error(std::move(Description)), Type(Type), ErrorCode(ErrorCode),
10 Line(Location.line()), Function(Location.function_name()), File(Location.file_name())
11 #ifdef DYNEXP_HAS_STACKTRACE
12 , Trace(std::stacktrace::current())
22 if (!Filename.empty() || !e.
Function.empty())
35 std::rethrow_exception(e);
41 catch (
const std::exception& e)
Provides exception type and error definitions used by DynExp.
static std::string FormatLog(const std::string &Message, const size_t Line=0, const std::string &Function="", const std::string &Filename="", const int ErrorCode=0, const bool PrefixMessage=true)
Formats a log entry as plain text to be displayed within DynExp.
DynExp exceptions are derived from this class. It contains basic information about the cause of the e...
const std::string File
Source code file where the exception occurred.
constexpr static const char * GetErrorLabel(const ErrorType Type)
Converts an error type to a user-readable label for logging.
const size_t Line
Line in source code where the exception occurred.
Exception(std::string Description, const ErrorType Type=ErrorType::Error, const int ErrorCode=-1, const std::source_location Location=std::source_location::current()) noexcept
Constructs an exception. Constructor is noexcept, although std::runtime_error() might throw std::bad_...
const std::string Function
Function in source code where the exception occurred
const int ErrorCode
DynExp error code from DynExpErrorCodes::DynExpErrorCodes
Class to forward an Exception instance from one DynExp::Object instance to another DynExp::Object ins...
DynExp's Util namespace contains commonly used functions and templates as well as extensions to Qt an...
auto FilenameFromPath(std::string Path)
Extracts the filename from a path.
void ForwardException(std::exception_ptr e)
Wraps the exception passed to the function in a ForwardedException and throws the ForwardedException....
auto CurrentTimeAndDateString()
Returns a human-readable string describing the current time and date in the current time zone.
std::ostream & operator<<(std::ostream &stream, const Exception &e)
Writes a DynExp exception in a user-readable way to a stream.
ErrorType
DynExp's error types
Accumulates include statements to provide a precompiled header.