Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat][C++] Output the error message when access value in Result fail #222

Merged
merged 1 commit into from
Aug 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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