mod_servlet
C++Servlets
 All Classes Files Functions Variables Typedefs Macros Pages
exception.h
Go to the documentation of this file.
1 /*
2 Copyright (c) 2016 Alexei Novakov
3 https://github.com/novalexei
4 
5 Distributed under the Boost Software License, Version 1.0.
6 http://boost.org/LICENSE_1_0.txt
7 */
8 #ifndef SERVLET_EXCEPTION_H
9 #define SERVLET_EXCEPTION_H
10 
22 #include <iostream>
23 #include <exception>
24 #include <stdexcept>
25 #include <typeinfo>
26 
27 namespace servlet
28 {
29 
33 struct config_exception : public std::runtime_error
34 {
35  using std::runtime_error::runtime_error;
36 };
40 struct security_exception : public std::runtime_error
41 {
42  using std::runtime_error::runtime_error;
43 };
47 struct io_exception : public std::runtime_error
48 {
49  using std::runtime_error::runtime_error;
50 };
55 struct null_pointer_exception : public std::runtime_error
56 {
57  using std::runtime_error::runtime_error;
58 };
62 struct invalid_argument_exception : public std::runtime_error
63 {
64  using std::runtime_error::runtime_error;
65 };
70 struct bad_cast : public std::runtime_error, public std::bad_cast
71 {
72  using std::runtime_error::runtime_error;
73 };
74 
85 std::ostream &operator<<(std::ostream &out, const std::exception &ex);
86 
87 } // end of servlet namespace
88 
89 #endif // SERVLET_EXCEPTION_H
Exception thrown on attempt to access nullptr object if this is possible to catch this attempt...
Definition: exception.h:55
Exception thrown on bad cast.
Definition: exception.h:70
Input/output exception.
Definition: exception.h:47
Configuration exception.
Definition: exception.h:33
Exception thrown on passing invalid argument.
Definition: exception.h:62
Security exception.
Definition: exception.h:40