@@ -81,12 +81,12 @@ void CasaLens::handle_error(pplx::task<void>& t)
81
81
82
82
pplx::task<void > CasaLens::open ()
83
83
{
84
- return m_listener.open ().then (handle_error);
84
+ return m_listener.open ().then ([](pplx::task< void > t) { handle_error (t); } );
85
85
}
86
86
87
87
pplx::task<void > CasaLens::close ()
88
88
{
89
- return m_listener.close ().then (handle_error);
89
+ return m_listener.close ().then ([](pplx::task< void > t) { handle_error (t); } );
90
90
}
91
91
92
92
// Handler to process HTTP::GET requests.
@@ -97,15 +97,15 @@ void CasaLens::handle_get(http_request message)
97
97
auto content_data = m_htmlcontentmap.find (path);
98
98
if (content_data == m_htmlcontentmap.end ())
99
99
{
100
- message.reply (status_codes::NotFound, U (" Path not found" )).then (handle_error);
100
+ message.reply (status_codes::NotFound, U (" Path not found" )).then ([](pplx::task< void > t) { handle_error (t); } );
101
101
return ;
102
102
}
103
103
104
104
auto file_name = std::get<0 >(content_data->second );
105
105
auto content_type = std::get<1 >(content_data->second );
106
106
concurrency::streams::fstream::open_istream (file_name, std::ios::in).then ([=](concurrency::streams::istream is)
107
107
{
108
- message.reply (status_codes::OK, is, content_type).then (handle_error);
108
+ message.reply (status_codes::OK, is, content_type).then ([](pplx::task< void > t) { handle_error (t); } );
109
109
}).then ([=](pplx::task<void >& t)
110
110
{
111
111
try
@@ -116,7 +116,7 @@ void CasaLens::handle_get(http_request message)
116
116
{
117
117
// opening the file (open_istream) failed.
118
118
// Reply with an error.
119
- message.reply (status_codes::InternalError).then (handle_error);
119
+ message.reply (status_codes::InternalError).then ([](pplx::task< void > t) { handle_error (t); } );
120
120
}
121
121
});
122
122
}
@@ -132,11 +132,11 @@ void CasaLens::handle_post(http_request message)
132
132
message.extract_string ().then ([=](const utility::string_t & location)
133
133
{
134
134
get_data (message, location);
135
- }).then (handle_error);
135
+ }).then ([](pplx::task< void > t) { handle_error (t); } );
136
136
}
137
137
else
138
138
{
139
- message.reply (status_codes::NotFound, U (" Path not found" )).then (handle_error);
139
+ message.reply (status_codes::NotFound, U (" Path not found" )).then ([](pplx::task< void > t) { handle_error (t); } );
140
140
}
141
141
}
142
142
0 commit comments