RESTinio
exception.hpp
Go to the documentation of this file.
1 /*
2  restinio
3 */
4 
9 #pragma once
10 
11 #include <string>
12 #include <stdexcept>
13 
14 #include <restinio/string_view.hpp>
15 
16 namespace restinio
17 {
18 
19 //
20 // exception_t
21 //
22 
25  : public std::runtime_error
26 {
27  using bast_type_t = std::runtime_error;
28  public:
29  exception_t( const char * err )
30  : bast_type_t{ err }
31  {}
32 
33  exception_t( const std::string & err )
34  : bast_type_t{ err }
35  {}
36 
38  : bast_type_t{ std::string{ err.data(), err.size() } }
39  {}
40 };
41 
42 } /* namespace restinio */
restinio::exception_t::exception_t
exception_t(string_view_t err)
Definition: exception.hpp:37
restinio::exception_t
Exception class for all exceptions thrown by RESTinio.
Definition: exception.hpp:26
restinio::exception_t::exception_t
exception_t(const char *err)
Definition: exception.hpp:29
string_view.hpp
restinio::string_view_t
nonstd::string_view string_view_t
Definition: string_view.hpp:19
restinio::exception_t::exception_t
exception_t(const std::string &err)
Definition: exception.hpp:33
restinio
Definition: asio_include.hpp:21
restinio::exception_t::bast_type_t
std::runtime_error bast_type_t
Definition: exception.hpp:27