summaryrefslogtreecommitdiff
path: root/zen/http.cpp
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-09-13 13:49:38 -0400
committerB. Stack <bgstack15@gmail.com>2023-09-13 13:49:38 -0400
commit7ed2158034ef5c26eed7fed9aa3c118d79a06fa8 (patch)
tree979e6628193f88d2140e722a3893321904869896 /zen/http.cpp
parentadd extra_log.h (diff)
downloadFreeFileSync-7ed2158034ef5c26eed7fed9aa3c118d79a06fa8.tar.gz
FreeFileSync-7ed2158034ef5c26eed7fed9aa3c118d79a06fa8.tar.bz2
FreeFileSync-7ed2158034ef5c26eed7fed9aa3c118d79a06fa8.zip
add upstream 13.013.0
Diffstat (limited to 'zen/http.cpp')
-rw-r--r--zen/http.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/zen/http.cpp b/zen/http.cpp
index 8cdcd65c..fcf69fb3 100644
--- a/zen/http.cpp
+++ b/zen/http.cpp
@@ -265,7 +265,17 @@ std::unique_ptr<HttpInputStream::Impl> sendHttpRequestImpl(const Zstring& url,
else
{
if (httpStatus != 200) //HTTP_STATUS_OK
- throw SysError(formatHttpError(httpStatus)); //e.g. "HTTP status 404: Not found."
+ {
+#if 0 //beneficial to add error details?
+ std::wstring errorDetails;
+ try
+ {
+ errorDetails = utfTo<std::wstring>(HttpInputStream(std::move(response)).readAll(nullptr /*notifyUnbufferedIO*/)); //throw SysError
+ }
+ catch (const SysError& e) { errorDetails = e.toString(); }
+#endif
+ throw SysError(formatHttpError(httpStatus) /*+ L' ' + errorDetails*/); //e.g. "HTTP status 404: Not found."
+ }
return response;
}
bgstack15