aligator  0.6.1
A primal-dual augmented Lagrangian-type solver for nonlinear trajectory optimization.
Loading...
Searching...
No Matches
exceptions.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <stdexcept>
4#include <fmt/color.h>
5
6#define ALIGATOR_RUNTIME_ERROR(msg) \
7 throw aligator::RuntimeError( \
8 fmt::format("{}({}): {}", __FILE__, __LINE__, msg))
9
10#define ALIGATOR_DOMAIN_ERROR(msg) \
11 throw std::domain_error(fmt::format("{}({}): {}", __FILE__, __LINE__, msg))
12
13#define ALIGATOR_WARNING(loc, msg) \
14 fmt::print(fmt::fg(fmt::color::yellow), "[{}] {}: {}", loc, __FUNCTION__, \
15 msg);
16
17namespace aligator {
18
19class RuntimeError : public std::runtime_error {
20public:
21 explicit RuntimeError(const std::string &what = "")
22 : std::runtime_error(what) {}
23};
24
25} // namespace aligator
RuntimeError(const std::string &what="")
Main package namespace.