Skip to content

Commit

Permalink
Solve #600 (ExtrapolationException & its error_code) (#601)
Browse files Browse the repository at this point in the history
* error_code shall follow same path of its error string

* Lint
  • Loading branch information
roncapat authored May 8, 2023
1 parent b037e20 commit ac2479e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tf2/src/buffer_core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ tf2::TF2Error BufferCore::walkToTopParent(
uint32_t depth = 0;

TF2Error error_code = TF2Error::TF2_NO_ERROR;
TF2Error extrapolation_error_code = TF2Error::TF2_NO_ERROR;
std::string extrapolation_error_string;
bool extrapolation_might_have_occurred = false;

Expand All @@ -367,7 +368,9 @@ tf2::TF2Error BufferCore::walkToTopParent(
break;
}

CompactFrameID parent = f.gather(cache, time, &extrapolation_error_string, &error_code);
CompactFrameID parent = f.gather(
cache, time, &extrapolation_error_string,
&extrapolation_error_code);
if (parent == 0) {
// Just break out here... there may still be a path from source -> target
top_parent = frame;
Expand Down Expand Up @@ -458,7 +461,7 @@ tf2::TF2Error BufferCore::walkToTopParent(
lookupFrameString(source_id) << "] to frame [" << lookupFrameString(target_id) << "]";
*error_string = ss.str();
}
return error_code;
return extrapolation_error_code;
}
createConnectivityErrorString(source_id, target_id, error_string);
return tf2::TF2Error::TF2_CONNECTIVITY_ERROR;
Expand Down

0 comments on commit ac2479e

Please sign in to comment.