Skip to content

Commit 4ca3574

Browse files
committed
Throw test exception
1 parent 475a27d commit 4ca3574

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lib/Database/Database.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include "IndexStoreDB/Database/UnitInfo.h"
1616
#include "IndexStoreDB/Support/Logging.h"
1717
#include "IndexStoreDB/Support/Path.h"
18+
#include "lmdb/lmdb++.h"
1819
#include "llvm/ADT/Hashing.h"
1920
#include "llvm/ADT/StringRef.h"
2021
#include "llvm/ADT/StringMap.h"
@@ -26,6 +27,7 @@
2627
#include "llvm/Support/raw_ostream.h"
2728
#include "llvm/Support/WindowsError.h"
2829
#include <exception>
30+
#include <stdexcept>
2931
#if defined(_WIN32)
3032
#define NOMINMAX
3133
#include "Windows.h"
@@ -201,6 +203,14 @@ Database::Implementation::create(StringRef path, bool readonly, Optional<size_t>
201203

202204
retry:
203205
fputs("CP 8.2.2.2.1.5.6\n", stderr);
206+
try {
207+
fputs("Throwing dummy error\n", stderr);
208+
throw lmdb::runtime_error{"test", 0};
209+
fputs("Threw dummy error\n", stderr);
210+
} catch (std::runtime_error err) {
211+
fputs("Caught error\n", stderr);
212+
}
213+
204214
try {
205215
fputs("CP 8.2.2.2.1.5.7\n", stderr);
206216
auto db = std::make_shared<Database::Implementation>();

0 commit comments

Comments
 (0)