Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[IE] Improve error messages in IStreamsExecutor::Config::set_property (#33979)

Tomasz Jankowskibef88e98ec3e
diff --git a/src/inference/src/dev/threading/istreams_executor.cpp b/src/inference/src/dev/threading/istreams_executor.cpp
index 653dfd6ce76..d2a7162bf1b 100644
--- a/src/inference/src/dev/threading/istreams_executor.cpp
+++ b/src/inference/src/dev/threading/istreams_executor.cpp
@@ -53,18 +53,18 @@ void IStreamsExecutor::Config::set_property(const ov::AnyMap& property) {
} catch (const std::exception&) {
OPENVINO_THROW("Wrong value for property key ",
ov::inference_num_threads.name(),
- ". Expected only positive numbers (#threads)");
- }
- if (val_i < 0) {
- OPENVINO_THROW("Wrong value for property key ",
- ov::inference_num_threads.name(),
- ". Expected only positive numbers (#threads)");
+ ". Expected only non negative integer numbers.");
}
+ OPENVINO_ASSERT(val_i >= 0,
+ "Wrong value for property key ",
+ ov::inference_num_threads.name(),
+ ". Expected only non negative integer numbers. Got: ",
+ val_i);
_threads = val_i;
} else if (key == ov::internal::threads_per_stream) {
_threads_per_stream = static_cast<int>(value.as<size_t>());
} else {
- OPENVINO_THROW("Wrong value for property key ", key);
+ OPENVINO_THROW("Not recognized property key ", key);
}
}
}