Send error when fetching remote assets fails
This commit is contained in:
@@ -255,6 +255,9 @@ void HttpServer::HandleGet(const httplib::Request &req,
|
|||||||
auto result = client.Get(req.path, req.params, {{"User-Agent", user_agent}});
|
auto result = client.Get(req.path, req.params, {{"User-Agent", user_agent}});
|
||||||
if (!result) {
|
if (!result) {
|
||||||
res.status = 500;
|
res.status = 500;
|
||||||
|
res.set_content("Could not fetch: '" + req.path + "' from '" + remote_url +
|
||||||
|
"': " + to_string(result.error()),
|
||||||
|
"text/plain");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user