(satori_publisher) better error handling

This commit is contained in:
Benjamin Sergeant
2018-11-07 14:54:44 -08:00
parent 135cfe3238
commit de8bcd36e8
6 changed files with 117 additions and 26 deletions

View File

@@ -56,7 +56,7 @@ int main(int argc, char* argv[])
std::ifstream f(path);
if (!f.is_open())
{
std::cerr << "error while opening file" << std::endl;
std::cerr << "Error while opening file: " << path << std::endl;
}
while (getline(f, line))
@@ -70,16 +70,23 @@ int main(int argc, char* argv[])
if (f.bad())
{
std::cerr << "error while reading file" << std::endl;
std::cerr << "Error while opening file: " << path << std::endl;
}
done = true;
}
);
satoriConnection.setErrorCallback(
[&done](const std::string& errMsg)
{
std::cerr << "Satori Error received: " << errMsg << std::endl;
done = true;
}
);
while (!done)
{
msleep(1000);
msleep(10);
}
std::cout << incomingBytes << std::endl;