2 // Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
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)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_HTTP_ERROR_HPP
11 #define BOOST_BEAST_HTTP_ERROR_HPP
13 #include <boost/beast/core/detail/config.hpp>
14 #include <boost/beast/core/error.hpp>
20 /// Error codes returned from HTTP algorithms and operations.
23 /** The end of the stream was reached.
25 This error is returned under the following conditions:
27 @li When attempting to read HTTP data from a stream and the stream
28 read returns the error `boost::asio::error::eof` before any new octets
31 @li When sending a complete HTTP message at once and the semantics of
32 the message are that the connection should be closed to indicate the
37 /** The incoming message is incomplete.
39 This happens when the end of stream is reached during
40 parsing and some octets have been received, but not the
45 /** Additional buffers are required.
47 This error is returned during parsing when additional
48 octets are needed. The caller should append more data
49 to the existing buffer and retry the parse operaetion.
53 /** An unexpected body was encountered during parsing.
55 This error is returned when attempting to parse body
56 octets into a message container which has the
57 @ref empty_body body type.
63 /** Additional buffers are required.
65 This error is returned under the following conditions:
67 @li During serialization when using @ref buffer_body.
68 The caller should update the body to point to a new
69 buffer or indicate that there are no more octets in
72 @li During parsing when using @ref buffer_body.
73 The caller should update the body to point to a new
74 storage area to receive additional body octets.
78 /** The end of a chunk was reached
82 /** Buffer maximum exceeded.
84 This error is returned when reading HTTP content
85 into a dynamic buffer, and the operation would
86 exceed the maximum size of the buffer.
90 /** Header limit exceeded.
92 The parser detected an incoming message header which
93 exceeded a configured limit.
97 /** Body limit exceeded.
99 The parser detected an incoming message body which
100 exceeded a configured limit.
104 /** A memory allocation failed.
106 When basic_fields throws std::bad_alloc, it is
107 converted into this error by @ref parser.
115 /// The line ending was malformed
118 /// The method is invalid.
121 /// The request-target is invalid.
124 /// The HTTP-version is invalid.
127 /// The status-code is invalid.
130 /// The reason-phrase is invalid.
133 /// The field name is invalid.
136 /// The field value is invalid.
139 /// The Content-Length is invalid.
142 /// The Transfer-Encoding is invalid.
143 bad_transfer_encoding,
145 /// The chunk syntax is invalid.
148 /// The chunk extension is invalid.
151 /// An obs-fold exceeded an internal limit.
159 #include <boost/beast/http/impl/error.ipp>