Clear error codes idiomatically

This commit is contained in:
Vinnie Falco
2019-01-20 09:50:43 -08:00
parent 9ea70bfbe5
commit 944b5dcda7
29 changed files with 118 additions and 112 deletions
+9 -9
View File
@@ -164,7 +164,7 @@ public:
on_request_impl(verb, string_view,
string_view, int, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
@@ -172,20 +172,20 @@ public:
string_view,
int, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
on_field_impl(field,
string_view, string_view, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
on_header_impl(error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
void
@@ -193,13 +193,13 @@ public:
boost::optional<std::uint64_t> const&,
error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
std::size_t
on_body_impl(string_view s, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
return s.size();
}
@@ -207,21 +207,21 @@ public:
on_chunk_header_impl(std::uint64_t,
string_view, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
std::size_t
on_chunk_body_impl(std::uint64_t,
string_view s, error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
return s.size();
}
void
on_finish_impl(error_code& ec)
{
ec.assign(0, ec.category());
ec = {};
}
};