From ce248aae6419d2b2339f930c4f119e8d51fb4947 Mon Sep 17 00:00:00 2001 From: Yves Date: Wed, 26 Mar 2025 09:21:22 +0100 Subject: [PATCH] Send error when fetching remote assets fails --- src/http_server.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/http_server.cpp b/src/http_server.cpp index a77827e..b0649d4 100644 --- a/src/http_server.cpp +++ b/src/http_server.cpp @@ -255,6 +255,9 @@ void HttpServer::HandleGet(const httplib::Request &req, auto result = client.Get(req.path, req.params, {{"User-Agent", user_agent}}); if (!result) { res.status = 500; + res.set_content("Could not fetch: '" + req.path + "' from '" + remote_url + + "': " + to_string(result.error()), + "text/plain"); return; }