isc_throw(BadValue, "'client-id' parameter must be a string");
}
- ClientIdPtr clientid = ClientId::fromText(client_id->stringValue());
+ ClientIdPtr clientid;
+ try {
+ clientid = ClientId::fromText(client_id->stringValue());
+ } catch (const std::exception& ex) {
+ isc_throw(BadValue, "bad 'client-id' parameter: " << ex.what());
+ }
Lease4Collection leases =
LeaseMgrFactory::instance().getLease4(*clientid);
isc_throw(BadValue, "'duid' parameter must be a string");
}
- DUID duid_ = DUID::fromText(duid->stringValue());
+ DUID duid_ = DUID::EMPTY();
+ try {
+ duid_ = DUID::fromText(duid->stringValue());
+ } catch (const std::exception& ex) {
+ isc_throw(BadValue, "bad 'duid' parameter: " << ex.what());
+ }
Lease6Collection leases =
LeaseMgrFactory::instance().getLeases6(duid_);
" \"client-id\": \"00::01:00:bc:0d:67\"\n"
" }\n"
"}";
- exp_rsp = "two consecutive separators (':') specified in a decoded string";
+ exp_rsp = "bad 'client-id' parameter: ";
+ exp_rsp += "two consecutive separators (':') specified in a decoded string";
exp_rsp += " '00::01:00:bc:0d:67'";
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
}
" \"duid\": \"00::01:00:bc:0d:67\"\n"
" }\n"
"}";
- exp_rsp = "two consecutive separators (':') specified in a decoded string";
+ exp_rsp = "bad 'duid' parameter: ";
+ exp_rsp += "two consecutive separators (':') specified in a decoded string";
exp_rsp += " '00::01:00:bc:0d:67'";
testCommand(cmd, CONTROL_RESULT_ERROR, exp_rsp);
}