Skip to content

Commit 0d31bff

Browse files
committed
Improved wording on unavailable devices
1 parent f0d8406 commit 0d31bff

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

depthai-core

src/DeviceBindings.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,14 @@ static auto deviceSearchHelper(Args&&... args){
170170
});
171171

172172
// if no devices found, then throw
173-
if(!found) throw std::runtime_error("No available devices");
173+
if(!found) {
174+
auto numConnected = DEVICE::getAllAvailableDevices().size();
175+
if(numConnected > 0) {
176+
throw std::runtime_error("No available devices (" + std::to_string(numConnected) + " connected, but in use)");
177+
} else {
178+
throw std::runtime_error("No available devices");
179+
}
180+
}
174181

175182
return deviceInfo;
176183
}

0 commit comments

Comments
 (0)