mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-30 11:32:03 +00:00
Fix error
This commit is contained in:
parent
0ebbe25c07
commit
db549c93a1
@ -123,7 +123,16 @@ void ReadWriteBufferFromHTTP::prepareRequest(Poco::Net::HTTPRequest & request, s
|
||||
std::optional<size_t> ReadWriteBufferFromHTTP::tryGetFileSize()
|
||||
{
|
||||
if (!file_info)
|
||||
file_info = getFileInfo();
|
||||
{
|
||||
try
|
||||
{
|
||||
file_info = getFileInfo();
|
||||
}
|
||||
catch (const HTTPException & e)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
}
|
||||
|
||||
return file_info->file_size;
|
||||
}
|
||||
@ -679,7 +688,7 @@ std::optional<time_t> ReadWriteBufferFromHTTP::tryGetLastModificationTime()
|
||||
{
|
||||
file_info = getFileInfo();
|
||||
}
|
||||
catch (...)
|
||||
catch (const HTTPException & e)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
@ -700,7 +709,7 @@ ReadWriteBufferFromHTTP::HTTPFileInfo ReadWriteBufferFromHTTP::getFileInfo()
|
||||
{
|
||||
getHeadResponse(response);
|
||||
}
|
||||
catch (HTTPException & e)
|
||||
catch (const HTTPException & e)
|
||||
{
|
||||
/// Maybe the web server doesn't support HEAD requests.
|
||||
/// E.g. webhdfs reports status 400.
|
||||
|
Loading…
Reference in New Issue
Block a user