]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | // |
2 | // Copyright (c) 2013-2017 Vinnie Falco (vinnie dot falco at gmail dot com) | |
3 | // | |
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) | |
6 | // | |
7 | ||
8 | #ifndef BEAST_HTTP_ERROR_HPP | |
9 | #define BEAST_HTTP_ERROR_HPP | |
10 | ||
11 | #include <beast/config.hpp> | |
12 | #include <beast/core/error.hpp> | |
13 | ||
14 | namespace beast { | |
15 | namespace http { | |
16 | ||
17 | /// Error codes returned from HTTP parsing | |
18 | enum class error | |
19 | { | |
20 | /** The end of the stream was reached. | |
21 | ||
22 | This error is returned by @ref basic_parser::write_eof | |
23 | when the end of stream is reached and there are no | |
24 | unparsed bytes in the stream buffer. | |
25 | */ | |
26 | end_of_stream = 1, | |
27 | ||
28 | /** The incoming message is incomplete. | |
29 | ||
30 | This happens when the end of stream is reached | |
31 | and some bytes have been received, but not the | |
32 | entire message. | |
33 | */ | |
34 | partial_message, | |
35 | ||
36 | /** Buffer maximum exceeded. | |
37 | ||
38 | This error is returned when reading HTTP content | |
39 | into a dynamic buffer, and the operation would | |
40 | exceed the maximum size of the buffer. | |
41 | */ | |
42 | buffer_overflow, | |
43 | ||
44 | /// The line ending was malformed | |
45 | bad_line_ending, | |
46 | ||
47 | /// The method is invalid. | |
48 | bad_method, | |
49 | ||
50 | /// The request-target is invalid. | |
51 | bad_path, | |
52 | ||
53 | /// The HTTP-version is invalid. | |
54 | bad_version, | |
55 | ||
56 | /// The status-code is invalid. | |
57 | bad_status, | |
58 | ||
59 | /// The reason-phrase is invalid. | |
60 | bad_reason, | |
61 | ||
62 | /// The field name is invalid. | |
63 | bad_field, | |
64 | ||
65 | /// The field value is invalid. | |
66 | bad_value, | |
67 | ||
68 | /// The Content-Length is invalid. | |
69 | bad_content_length, | |
70 | ||
71 | /// The Transfer-Encoding is invalid. | |
72 | bad_transfer_encoding, | |
73 | ||
74 | /// The chunk syntax is invalid. | |
75 | bad_chunk | |
76 | }; | |
77 | ||
78 | } // http | |
79 | } // beast | |
80 | ||
81 | #include <beast/http/impl/error.ipp> | |
82 | ||
83 | #endif |