35#ifndef LIBTCOD_ERROR_HPP_
36#define LIBTCOD_ERROR_HPP_
65 throw std::runtime_error(error_msg);
68 throw std::invalid_argument(error_msg);
78inline void check_path(
const std::filesystem::path& path) {
79 if (!std::filesystem::exists(path)) {
80 throw std::runtime_error(std::string(
"File not found:\n") + std::filesystem::absolute(path).
string());
TCOD_Error
An enum of libtcod error codes.
Definition error.h:48
@ TCOD_E_INVALID_ARGUMENT
The function failed because a given input argument was invalid.
Definition error.h:66
@ TCOD_E_ERROR
The error code for generic runtime errors.
Definition error.h:62
#define TCOD_set_errorv(msg)
Set an error with version, file, and line info added to the output.
Definition error.h:124
const char * TCOD_get_error(void)
Return the last error message.
The libtcod namespace.
Definition bresenham.hpp:157
TCOD_Error set_error(const std::string &msg)
Set an error message and return a relevant error code, usually -1.
Definition error.hpp:50
void check_path(const std::filesystem::path &path)
Throw an exception if the given path does not exist.
Definition error.hpp:78
int check_throw_error(int error)
Check and throw error messages.
Definition error.hpp:57