Web framework C++  2.0.0
Simple web framework on c++ designed to easily create web pages, etc
runtime_exception.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <exception>
4 #include <string>
5 
11 class RuntimeException : public std::exception {
12  std::string _error;
13 public:
20  explicit RuntimeException(const std::string & error) {
21  _error = error;
22  }
23 
30  explicit RuntimeException(const char * error) {
31  _error = error;
32  }
33 
40  const char * what() const noexcept override {
41  return _error.c_str();
42  }
43 };
RuntimeException(const char *error)
Definition: runtime_exception.h:30
RuntimeException(const std::string &error)
Definition: runtime_exception.h:20
const char * what() const noexceptoverride
Definition: runtime_exception.h:40
exception class for program errors
Definition: runtime_exception.h:11