mirror of
https://github.com/ceph/ceph
synced 2025-02-05 18:03:54 +00:00
Merge pull request #30087 from egggHang/ec_benchmark
test/erasure-code: add exception handling to k & m Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
8b88ab0f2c
@ -121,10 +121,15 @@ int ErasureCodeBench::setup(int argc, char** argv) {
|
||||
exhaustive_erasures = false;
|
||||
if (vm.count("erased") > 0)
|
||||
erased = vm["erased"].as<vector<int> >();
|
||||
|
||||
k = stoi(profile["k"]);
|
||||
m = stoi(profile["m"]);
|
||||
|
||||
try {
|
||||
k = stoi(profile["k"]);
|
||||
m = stoi(profile["m"]);
|
||||
} catch (const std::logic_error& e) {
|
||||
cout << "Invalid k and/or m: k=" << profile["k"] << ", m=" << profile["m"]
|
||||
<< " (" << e.what() << ")" << endl;
|
||||
return -EINVAL;
|
||||
}
|
||||
if (k <= 0) {
|
||||
cout << "parameter k is " << k << ". But k needs to be > 0." << endl;
|
||||
return -EINVAL;
|
||||
|
Loading…
Reference in New Issue
Block a user