Skip to content

Commit

Permalink
[Feat][C++] Output the error message when access value in Result fail (
Browse files Browse the repository at this point in the history
  • Loading branch information
acezen committed Aug 15, 2023
1 parent 3cd7038 commit c810364
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions cpp/include/gar/external/result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4285,6 +4285,7 @@ auto RESULT_NS_IMPL::detail::throw_bad_result_access(E&& error) -> void
>;

throw exception_type{
error.message(),
detail::forward<E>(error)
};
#endif
Expand Down
4 changes: 2 additions & 2 deletions cpp/include/gar/graph_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -1182,7 +1182,7 @@ class GraphInfo {
noexcept {
if (vertex2info_.find(label) == vertex2info_.end()) {
return Status::KeyError("The vertex info of ", label,
"is not found in graph info.");
" is not found in graph info.");
}
return vertex2info_.at(label);
}
Expand Down Expand Up @@ -1219,7 +1219,7 @@ class GraphInfo {
const std::string& label, const std::string& property) const noexcept {
if (vertex2info_.find(label) == vertex2info_.end()) {
return Status::KeyError("The vertex info of ", label,
"is not found in graph info.");
" is not found in graph info.");
}
return vertex2info_.at(label).GetPropertyGroup(property);
}
Expand Down
2 changes: 1 addition & 1 deletion cpp/test/test_builder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ TEST_CASE("test_edges_builder") {
lines++;
std::string val;
std::istringstream readstr(line);
int64_t s, d;
int64_t s = 0, d = 0;
for (int i = 0; i < 3; i++) {
getline(readstr, val, '|');
if (i == 0) {
Expand Down

0 comments on commit c810364

Please sign in to comment.