Skip to content

Commit

Permalink
Added errno reporting on failure. JIRA: CXX-13647
Browse files Browse the repository at this point in the history
git-svn-id: https://anonsvn.ncbi.nlm.nih.gov/repos/v1/trunk/c++@102658 78c7ea69-d796-4a43-9a09-de51944f1b03
  • Loading branch information
gouriano committed Jun 21, 2024
1 parent b28a670 commit e4ffcd6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/util/bytesrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,10 @@ CFStreamByteSource::CFStreamByteSource(const string& fileName, bool binary)
IFStreamFlags(binary)))
{
if ( !*m_Stream ) {
NCBI_THROW(CUtilException,eNoInput,"file not found: " + fileName);
CNcbiError::SetFromErrno();
NCBI_THROW(CUtilException,eNoInput, string("No input data: ")
+ NCBI_ERRNO_STR_WRAPPER(NCBI_ERRNO_CODE_WRAPPER())
+ string(": ") + fileName);
}
}

Expand Down Expand Up @@ -433,8 +436,10 @@ CFileByteSourceReader::CFileByteSourceReader(const CFileByteSource* source)
if ( !m_FStream ) {
// THROW1_TRACE(runtime_error, "file not found: " +
// source->GetFileName());
NCBI_THROW(CUtilException,eNoInput,
"file not found: " +source->GetFileName());
CNcbiError::SetFromErrno();
NCBI_THROW(CUtilException,eNoInput, string("No input data: ")
+ NCBI_ERRNO_STR_WRAPPER(NCBI_ERRNO_CODE_WRAPPER())
+ string(": ") + source->GetFileName());
}
m_Stream = &m_FStream;
}
Expand Down

0 comments on commit e4ffcd6

Please sign in to comment.
-