storage/curl: throw HttpStatusError
This commit is contained in:
parent
5cd86e272f
commit
d5bf128cee
|
@ -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:
|
||||||
/* 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");
|
||||||
|
|
Loading…
Reference in New Issue