summaryrefslogtreecommitdiffstats
path: root/src/sim/trex_sim_stateless.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/sim/trex_sim_stateless.cpp')
-rw-r--r--src/sim/trex_sim_stateless.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sim/trex_sim_stateless.cpp b/src/sim/trex_sim_stateless.cpp
index 13f264cf..46b9916f 100644
--- a/src/sim/trex_sim_stateless.cpp
+++ b/src/sim/trex_sim_stateless.cpp
@@ -268,12 +268,16 @@ SimStateless::prepare_dataplane() {
void
SimStateless::execute_json(const std::string &json_filename) {
-
+ std::string rep;
std::ifstream test(json_filename);
std::stringstream buffer;
buffer << test.rdbuf();
- std::string rep = m_trex_stateless->get_rpc_server()->test_inject_request(buffer.str());
+ try {
+ rep = m_trex_stateless->get_rpc_server()->test_inject_request(buffer.str());
+ } catch (TrexRpcException &e) {
+ throw SimRunException(e.what());
+ }
Json::Value root;
Json::Reader reader;