-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathexcept.cpp
More file actions
121 lines (107 loc) · 2.07 KB
/
except.cpp
File metadata and controls
121 lines (107 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//
// Copyright (c) 2019 Vinnie Falco ([email protected])
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/cppalliance/http
//
#include <boost/http/detail/except.hpp>
#include <boost/system/system_error.hpp>
#include <boost/version.hpp>
#include <boost/throw_exception.hpp>
#include <stdexcept>
#include <typeinfo>
namespace boost {
namespace http {
namespace detail {
void
throw_bad_alloc(
source_location const& loc)
{
throw_exception(
std::bad_alloc(), loc);
}
void
throw_bad_typeid(
source_location const& loc)
{
throw_exception(
std::bad_typeid(), loc);
}
void
throw_invalid_argument(
source_location const& loc)
{
throw_exception(
std::invalid_argument(
"invalid argument"),
loc);
}
void
throw_invalid_argument(
char const* what,
source_location const& loc)
{
throw_exception(
std::invalid_argument(what), loc);
}
void
throw_length_error(
source_location const& loc)
{
throw_exception(
std::length_error(
"length error"), loc);
}
void
throw_length_error(
char const* what,
source_location const& loc)
{
throw_exception(
std::length_error(what), loc);
}
void
throw_logic_error(
source_location const& loc)
{
throw_exception(
std::logic_error(
"logic error"),
loc);
}
void
throw_out_of_range(
source_location const& loc)
{
throw_exception(
std::out_of_range("out of range"), loc);
}
void
throw_runtime_error(
char const* what,
source_location const& loc)
{
throw_exception(
std::runtime_error(what), loc);
}
void
throw_system_error(
system::error_code const& ec,
source_location const& loc)
{
throw_exception(
system::system_error(ec), loc);
}
void
throw_system_error(
error e,
source_location const& loc)
{
throw_exception(
system::system_error(e), loc);
}
} // detail
} // http
} // boost