Merge pull request #58165 from azat/s3-passthrough-exception

Pass through exceptions for reading from S3
This commit is contained in:
Alexey Milovidov 2023-12-23 11:35:23 +01:00 committed by GitHub
commit a400657155
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -34,6 +34,11 @@ bool ReadBufferFromIStream::nextImpl()
ReadBufferFromIStream::ReadBufferFromIStream(std::istream & istr_, size_t size)
: BufferWithOwnMemory<ReadBuffer>(size), istr(istr_)
{
/// - badbit will be set if some exception will be throw from ios implementation
/// - failbit can be set when for instance read() reads less data, so we
/// cannot set it, since we are requesting to read more data, then the
/// buffer has now.
istr.exceptions(std::ios::badbit);
}
}

View File

@ -196,7 +196,7 @@ bool ReadBufferFromS3::nextImpl()
next_result = impl->next();
break;
}
catch (Exception & e)
catch (Poco::Exception & e)
{
if (!processException(e, getPosition(), attempt) || last_attempt)
throw;