6#include "ll/api/base/CompilerPredefine.h"
7#include "ll/api/base/Macro.h"
8#include "ll/api/base/StdInt.h"
9#include "ll/api/utils/StacktraceUtils.h"
11#include "ll/api/io/LogLevel.h"
13#include "mc/deps/core/utility/optional_ref.h"
15namespace ll::inline utils::error_utils {
20 LLAPI
void* typeCast(std::type_info
const&)
const;
33 return reinterpret_cast<T*
>(typeCast(
typeid(T)));
37LLNDAPI std::system_error getLastSystemError() noexcept;
39LLNDAPI
std::exception_ptr createExceptionPtr(
void*) noexcept;
41LLNDAPI Stacktrace stacktraceFromCurrentException(
size_t skip = 0,
size_t maxDepth = ~0ull);
43LLNDAPI
std::
string makeExceptionString(
std::exception_ptr ePtr) noexcept;
45LLAPI
void printCurrentException(
47 io::LogLevel level = io::LogLevel::Error,
48 std::exception_ptr const& =
std::current_exception()
52 requires(!
std::is_same_v<T,
std::exception_ptr>)
53inline
void printException(T const& e, io::Logger& logger, io::LogLevel level = io::LogLevel::Error) noexcept {
54 printCurrentException(logger, level, std::make_exception_ptr(e));
Definition optional_ref.h:10
Definition ErrorUtils.h:17