Examples: Add more error reporting

This commit is contained in:
Thomas Stoddard
2026-05-13 17:03:01 -04:00
committed by Kyle Schwarz
parent c466d75dae
commit 5620c98eda
16 changed files with 81 additions and 8 deletions
+7
View File
@@ -48,6 +48,13 @@ int main()
// You now hold the shared_ptrs for these devices, you are considered to "own" these devices from a memory perspective
std::cout << "OK, " << devices.size() << " device" << (devices.size() == 1 ? "" : "s") << " found" << std::endl;
if(devices.empty()) {
auto lastError = icsneo::GetLastError();
if(lastError.getType() != icsneo::APIEvent::Type::NoErrorFound)
std::cout << lastError << std::endl;
return 0;
}
// List off the devices
for (auto &device : devices)
std::cout << '\t' << device->describe() << " @ Handle " << device->getNeoDevice().handle << std::endl;