Skip to content

Commit

Permalink
Use nested exceptions to avoid masking error messages.
Browse files Browse the repository at this point in the history
  • Loading branch information
teo-tsirpanis committed Aug 20, 2024
1 parent 17f67b7 commit fd2d394
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tiledb/sm/c_api/tiledb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1487,7 +1487,8 @@ capi_return_t tiledb_array_delete_fragments_v2(
array.delete_fragments(uri, timestamp_start, timestamp_end);
} catch (...) {
throw_if_not_ok(array.close());
throw api::CAPIStatusException("Failed to delete fragments");
std::throw_with_nested(
api::CAPIStatusException("Failed to delete fragments"));
}

// Close and delete the array
Expand Down Expand Up @@ -1541,7 +1542,8 @@ capi_return_t tiledb_array_delete_fragments_list(
array.delete_fragments_list(uris);
} catch (...) {
throw_if_not_ok(array.close());
throw api::CAPIStatusException("Failed to delete fragments_list");
std::throw_with_nested(
api::CAPIStatusException("Failed to delete fragments_list"));
}

// Close the array
Expand Down

0 comments on commit fd2d394

Please sign in to comment.