MCPcopy Create free account
hub / github.com/TileDB-Inc/TileDB / main

Function main

examples/cpp_api/errors.cc:38–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36using namespace tiledb;
37
38int main() {
39 // Create TileDB context
40 Context ctx;
41 tiledb::VFS vfs(ctx);
42 if (vfs.is_dir("my_group"))
43 vfs.remove_dir("my_group");
44
45 // Catch an error
46 try {
47 create_group(ctx, "my_group");
48 create_group(ctx, "my_group");
49 } catch (tiledb::TileDBError& e) {
50 Error err(ctx);
51 std::string msg = err.error_message();
52 std::cout << "Last error: " << msg << "\n";
53 std::cout << "TileDB exception:\n" << e.what() << "\n";
54 }
55
56 // Set a different error handler
57 ctx.set_error_handler([](std::string msg) {
58 std::cout << "Callback:\n" << msg << "\n";
59 });
60 create_group(ctx, "my_group");
61
62 return 0;
63}

Callers

nothing calls this directly

Calls 5

create_groupFunction · 0.85
error_messageMethod · 0.80
is_dirMethod · 0.45
remove_dirMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected