Commit d5bf128c authored by Max Kellermann's avatar Max Kellermann

storage/curl: throw HttpStatusError

parent 5cd86e27
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include "storage/StorageInterface.hxx" #include "storage/StorageInterface.hxx"
#include "storage/FileInfo.hxx" #include "storage/FileInfo.hxx"
#include "storage/MemoryDirectoryReader.hxx" #include "storage/MemoryDirectoryReader.hxx"
#include "lib/curl/Error.hxx"
#include "lib/curl/Init.hxx" #include "lib/curl/Init.hxx"
#include "lib/curl/Global.hxx" #include "lib/curl/Global.hxx"
#include "lib/curl/Slist.hxx" #include "lib/curl/Slist.hxx"
...@@ -300,8 +301,9 @@ private: ...@@ -300,8 +301,9 @@ private:
/* virtual methods from CurlResponseHandler */ /* virtual methods from CurlResponseHandler */
void OnHeaders(unsigned status, Curl::Headers &&headers) final { void OnHeaders(unsigned status, Curl::Headers &&headers) final {
if (status != 207) if (status != 207)
throw FormatRuntimeError("Status %d from WebDAV server; expected \"207 Multi-Status\"", throw HttpStatusError(status,
status); StringFormat<80>("Status %u from WebDAV server; expected \"207 Multi-Status\"",
status).c_str());
if (!IsXmlContentType(headers)) if (!IsXmlContentType(headers))
throw std::runtime_error("Unexpected Content-Type from WebDAV server"); throw std::runtime_error("Unexpected Content-Type from WebDAV server");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment