VIPRA Documentation
Loading...
Searching...
No Matches
exceptions.hpp
1#pragma once
2
3#include <stdexcept>
4
5namespace VIPRA::Behaviors {
6class DSLException : public std::runtime_error {
7 public:
8 explicit DSLException() : std::runtime_error("") {}
9 explicit DSLException(std::string const& message) : std::runtime_error(message) {}
10
11 [[noreturn]] static void error(std::string const& message)
12 {
13 throw DSLException(message);
14 }
15 [[noreturn]] static void error() { throw DSLException(); }
16};
17
18class BuilderException : public std::runtime_error {
19 public:
20 explicit BuilderException() : std::runtime_error("") {}
21 [[noreturn]] static void error() { throw BuilderException(); }
22};
23} // namespace VIPRA::Behaviors