1  
//
1  
//
2  
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
2  
// Copyright (c) 2019 Vinnie Falco (vinnie.falco@gmail.com)
3  
//
3  
//
4  
// Distributed under the Boost Software License, Version 1.0. (See accompanying
4  
// Distributed under the Boost Software License, Version 1.0. (See accompanying
5  
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5  
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6  
//
6  
//
7  
// Official repository: https://github.com/cppalliance/http
7  
// Official repository: https://github.com/cppalliance/http
8  
//
8  
//
9  

9  

10  
#ifndef BOOST_HTTP_DETAIL_EXCEPT_HPP
10  
#ifndef BOOST_HTTP_DETAIL_EXCEPT_HPP
11  
#define BOOST_HTTP_DETAIL_EXCEPT_HPP
11  
#define BOOST_HTTP_DETAIL_EXCEPT_HPP
12  

12  

13  
#include <boost/http/error.hpp>
13  
#include <boost/http/error.hpp>
14  
#include <boost/assert/source_location.hpp>
14  
#include <boost/assert/source_location.hpp>
15  

15  

16  
namespace boost {
16  
namespace boost {
17  
namespace http {
17  
namespace http {
18  
namespace detail {
18  
namespace detail {
19  

19  

20  
BOOST_HTTP_DECL void BOOST_NORETURN throw_bad_alloc(
20  
BOOST_HTTP_DECL void BOOST_NORETURN throw_bad_alloc(
21  
    source_location const& loc = BOOST_CURRENT_LOCATION);
21  
    source_location const& loc = BOOST_CURRENT_LOCATION);
22  

22  

23  
BOOST_HTTP_DECL void BOOST_NORETURN throw_bad_typeid(
23  
BOOST_HTTP_DECL void BOOST_NORETURN throw_bad_typeid(
24  
    source_location const& loc = BOOST_CURRENT_LOCATION);
24  
    source_location const& loc = BOOST_CURRENT_LOCATION);
25  

25  

26  
BOOST_HTTP_DECL void BOOST_NORETURN throw_invalid_argument(
26  
BOOST_HTTP_DECL void BOOST_NORETURN throw_invalid_argument(
27  
    source_location const& loc = BOOST_CURRENT_LOCATION);
27  
    source_location const& loc = BOOST_CURRENT_LOCATION);
28  

28  

29  
BOOST_HTTP_DECL void BOOST_NORETURN throw_invalid_argument(
29  
BOOST_HTTP_DECL void BOOST_NORETURN throw_invalid_argument(
30  
    char const* what,
30  
    char const* what,
31  
    source_location const& loc = BOOST_CURRENT_LOCATION);
31  
    source_location const& loc = BOOST_CURRENT_LOCATION);
32  

32  

33  
BOOST_HTTP_DECL void BOOST_NORETURN throw_length_error(
33  
BOOST_HTTP_DECL void BOOST_NORETURN throw_length_error(
34  
    source_location const& loc = BOOST_CURRENT_LOCATION);
34  
    source_location const& loc = BOOST_CURRENT_LOCATION);
35  

35  

36  
BOOST_HTTP_DECL void BOOST_NORETURN throw_length_error(
36  
BOOST_HTTP_DECL void BOOST_NORETURN throw_length_error(
37  
    char const* what,
37  
    char const* what,
38  
    source_location const& loc = BOOST_CURRENT_LOCATION);
38  
    source_location const& loc = BOOST_CURRENT_LOCATION);
39  

39  

40  
BOOST_HTTP_DECL void BOOST_NORETURN throw_logic_error(
40  
BOOST_HTTP_DECL void BOOST_NORETURN throw_logic_error(
41  
    source_location const& loc = BOOST_CURRENT_LOCATION);
41  
    source_location const& loc = BOOST_CURRENT_LOCATION);
42  

42  

43  
BOOST_HTTP_DECL void BOOST_NORETURN throw_out_of_range(
43  
BOOST_HTTP_DECL void BOOST_NORETURN throw_out_of_range(
44  
    source_location const& loc = BOOST_CURRENT_LOCATION);
44  
    source_location const& loc = BOOST_CURRENT_LOCATION);
45  

45  

46  
BOOST_HTTP_DECL void BOOST_NORETURN throw_runtime_error(
46  
BOOST_HTTP_DECL void BOOST_NORETURN throw_runtime_error(
47  
    char const* what,
47  
    char const* what,
48  
    source_location const& loc = BOOST_CURRENT_LOCATION);
48  
    source_location const& loc = BOOST_CURRENT_LOCATION);
49  

49  

50  
BOOST_HTTP_DECL void BOOST_NORETURN throw_system_error(
50  
BOOST_HTTP_DECL void BOOST_NORETURN throw_system_error(
51  
    system::error_code const& ec,
51  
    system::error_code const& ec,
52  
    source_location const& loc = BOOST_CURRENT_LOCATION);
52  
    source_location const& loc = BOOST_CURRENT_LOCATION);
53  

53  

54  
BOOST_HTTP_DECL void BOOST_NORETURN throw_system_error(
54  
BOOST_HTTP_DECL void BOOST_NORETURN throw_system_error(
55  
    error e,
55  
    error e,
56  
    source_location const& loc = BOOST_CURRENT_LOCATION);
56  
    source_location const& loc = BOOST_CURRENT_LOCATION);
57  

57  

58  
} // detail
58  
} // detail
59  
} // http
59  
} // http
60  
} // boost
60  
} // boost
61  

61  

62  
#endif
62  
#endif