mirror of
https://github.com/eclipse/upm.git
synced 2025-03-15 04:57:30 +03:00
grovescam: throw exception(s) on fatal read() as well
Signed-off-by: Jon Trulson <jtrulson@ics.com> Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
parent
8d38bd0bcc
commit
56ddb441d4
@ -119,7 +119,12 @@ int GROVESCAM::readData(uint8_t *buffer, int len)
|
||||
int rv = read(m_ttyFd, (char *)buffer, len);
|
||||
|
||||
if (rv < 0)
|
||||
cerr << __FUNCTION__ << ": read failed: " << strerror(errno) << endl;
|
||||
{
|
||||
throw std::runtime_error(std::string(__FUNCTION__) +
|
||||
": read() failed: " +
|
||||
string(strerror(errno)));
|
||||
return rv;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user