Fix empty rethrows, update some catches to catch all (#2362)
* Fix empty rethrows, update some catches to catch all * AZURE_UNREACHABLE_CODE() Co-authored-by: JinmingHu <jinmhu@microsoft.com> Co-authored-by: Anton Kolesnyk <antkmsft@users.noreply.github.com> Co-authored-by: JinmingHu <jinmhu@microsoft.com>
This commit is contained in:
parent
a742608406
commit
15c525d387
@ -996,7 +996,7 @@ int64_t CurlSession::ResponseBufferParser::Parse(
|
||||
{
|
||||
// Should never happen that parser is not statusLIne or Headers and we still try
|
||||
// to parse more.
|
||||
throw;
|
||||
AZURE_UNREACHABLE_CODE();
|
||||
}
|
||||
// clean internal buffer
|
||||
this->m_internalBuffer.clear();
|
||||
@ -1034,7 +1034,7 @@ int64_t CurlSession::ResponseBufferParser::Parse(
|
||||
{
|
||||
// Should never happen that parser is not statusLIne or Headers and we still try
|
||||
// to parse more.
|
||||
throw;
|
||||
AZURE_UNREACHABLE_CODE();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ FileBodyStream::FileBodyStream(const std::string& filename)
|
||||
m_randomAccessFileBodyStream = std::make_unique<_internal::RandomAccessFileBodyStream>(
|
||||
_internal::RandomAccessFileBodyStream(m_filehandle, 0, fileSize.QuadPart));
|
||||
}
|
||||
catch (const std::exception&)
|
||||
catch (...)
|
||||
{
|
||||
if (fileHandle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
@ -156,7 +156,7 @@ FileBodyStream::FileBodyStream(const std::string& filename)
|
||||
m_randomAccessFileBodyStream = std::make_unique<_internal::RandomAccessFileBodyStream>(
|
||||
_internal::RandomAccessFileBodyStream(m_fileDescriptor, 0, fileSize));
|
||||
}
|
||||
catch (const std::exception&)
|
||||
catch (...)
|
||||
{
|
||||
close(m_fileDescriptor);
|
||||
throw;
|
||||
|
||||
@ -88,7 +88,7 @@ public:
|
||||
}
|
||||
default:
|
||||
// imposible to get here
|
||||
throw;
|
||||
AZURE_UNREACHABLE_CODE();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user