Skip to content

Commit 4262f53

Browse files
committed
Throw runtime_error instead of exception.
1 parent 738f438 commit 4262f53

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Diff for: tiledb/common/thread_pool/test/unit_thread_pool.cc

+8-7
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <cstdio>
3737
#include <iostream>
3838
#include <random>
39+
#include <stdexcept>
3940
#include <vector>
4041

4142
#include "tiledb/common/thread_pool/thread_pool.h"
@@ -445,7 +446,7 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
445446
results.push_back(pool.execute([&result]() {
446447
auto tmp = result++;
447448
if (tmp == 13) {
448-
throw std::exception("Unripe banana");
449+
throw std::runtime_error("Unripe banana");
449450
}
450451
}));
451452
}
@@ -480,7 +481,7 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
480481
throw std::string("Unripe banana");
481482
}
482483
if (tmp == 31) {
483-
throw std::exception("Unbaked potato");
484+
throw std::runtime_error("Unbaked potato");
484485
}
485486
}));
486487
}
@@ -501,7 +502,7 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
501502
throw std::string("Unripe banana");
502503
}
503504
if (tmp == 13) {
504-
throw std::exception("Unbaked potato");
505+
throw std::runtime_error("Unbaked potato");
505506
}
506507
}));
507508
}
@@ -519,10 +520,10 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
519520
results.push_back(pool.execute([i, &result]() {
520521
result++;
521522
if (i == 13) {
522-
throw std::exception("Unripe banana");
523+
throw std::runtime_error("Unripe banana");
523524
}
524525
if (i == 31) {
525-
throw std::exception("Unbaked potato");
526+
throw std::runtime_error("Unbaked potato");
526527
}
527528
}));
528529
}
@@ -540,10 +541,10 @@ TEST_CASE("ThreadPool: Test Exceptions", "[threadpool][exceptions]") {
540541
results.push_back(pool.execute([i, &result]() {
541542
++result;
542543
if (i == 31) {
543-
throw(std::exception("Unripe banana"));
544+
throw(std::runtime_error("Unripe banana"));
544545
}
545546
if (i == 13) {
546-
throw std::exception("Unbaked potato");
547+
throw std::runtime_error("Unbaked potato");
547548
}
548549
}));
549550
}

0 commit comments

Comments
 (0)