VIPRA Documentation
Loading...
Searching...
No Matches
errors.hpp
1#pragma once
2
3#include "vipra/logging/logging.hpp"
4
5#define VIPRA_MODULE_ERROR(message, ...) \
6 { \
7 VIPRA::Log::error("{} Module Error: {}\nAt: {}:{} ", module_name(), \
8 fmt::format(message __VA_OPT__(, ) __VA_ARGS__), __FILE__, \
9 __LINE__); \
10 throw std::runtime_error( \
11 fmt::format("{} Module Error: {}", module_name(), \
12 fmt::format(message __VA_OPT__(, ) __VA_ARGS__))); \
13 }
14
15#define VIPRA_BASE_MODULE_ERROR(type, message, ...) \
16 { \
17 VIPRA::Log::error("{} Module Error: {}\nAt: {}:{}", type, \
18 fmt::format(message __VA_OPT__(, ) __VA_ARGS__), __FILE__, \
19 __LINE__); \
20 throw std::runtime_error(fmt::format( \
21 "{} Module Error: {}", type, fmt::format(message __VA_OPT__(, ) __VA_ARGS__))); \
22 }