Skip to content

Commit

Permalink
resource: remove error message clearing
Browse files Browse the repository at this point in the history
The public traverser API functions now clear the traverser error message
prior to traversal operations.

Remove the function calls in resource to clear the error message.
  • Loading branch information
milroy committed Jan 10, 2025
1 parent 59000b2 commit 73222a7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 10 deletions.
3 changes: 0 additions & 3 deletions resource/modules/resource_match.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,6 @@ static int mark_now (std::shared_ptr<resource_ctx_t> &ctx,
"%s: traverser::mark: %s",
__FUNCTION__,
ctx->traverser->err_message ().c_str ());
ctx->traverser->clear_err_message ();
goto done;
}
flux_log (ctx->h,
Expand Down Expand Up @@ -2685,7 +2684,6 @@ static int run_find (std::shared_ptr<resource_ctx_t> &ctx,
"%s: %s",
__FUNCTION__,
ctx->traverser->err_message ().c_str ());
ctx->traverser->clear_err_message ();
}
goto error;
}
Expand Down Expand Up @@ -2956,7 +2954,6 @@ static void set_status_request_cb (flux_t *h,
"%s: traverser::mark: %s",
__FUNCTION__,
ctx->traverser->err_message ().c_str ());
ctx->traverser->clear_err_message ();
errmsg = "Failed to set status of resource vertex";
goto error;
}
Expand Down
2 changes: 0 additions & 2 deletions resource/reapi/bindings/c++/reapi_cli_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,6 @@ int resource_query_t::remove_job (const uint64_t jobid)
}
} else {
m_err_msg += traverser->err_message ();
traverser->clear_err_message ();
}
return rc;
}
Expand Down Expand Up @@ -716,7 +715,6 @@ int resource_query_t::remove_job (const uint64_t jobid, const std::string &R, bo
}
} else {
m_err_msg += traverser->err_message ();
traverser->clear_err_message ();
}

return rc;
Expand Down
5 changes: 0 additions & 5 deletions resource/utilities/command.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ static int do_remove (std::shared_ptr<resource_context_t> &ctx, int64_t jobid)
}
} else {
std::cout << ctx->traverser->err_message ();
ctx->traverser->clear_err_message ();
}
return rc;
}
Expand All @@ -135,7 +134,6 @@ static int do_partial_remove (std::shared_ptr<resource_context_t> &ctx,
}
} else {
std::cout << ctx->traverser->err_message ();
ctx->traverser->clear_err_message ();
}
return rc;
}
Expand Down Expand Up @@ -295,7 +293,6 @@ static int run_match (std::shared_ptr<resource_context_t> &ctx,

if (ctx->traverser->err_message () != "") {
std::cerr << "ERROR: " << ctx->traverser->err_message ();
ctx->traverser->clear_err_message ();
}
if ((rc = ctx->writers->emit (o)) < 0) {
std::cerr << "ERROR: match writer emit: " << strerror (errno) << std::endl;
Expand Down Expand Up @@ -436,7 +433,6 @@ static int update_run (std::shared_ptr<resource_context_t> &ctx,
std::cerr << "ERROR: traverser run () returned error " << std::endl;
if (ctx->traverser->err_message () != "") {
std::cerr << "ERROR: " << ctx->traverser->err_message ();
ctx->traverser->clear_err_message ();
}
}
}
Expand Down Expand Up @@ -619,7 +615,6 @@ int cmd_find (std::shared_ptr<resource_context_t> &ctx, std::vector<std::string>
if ((rc = ctx->traverser->find (ctx->writers, criteria)) < 0) {
if (ctx->traverser->err_message () != "") {
std::cerr << "ERROR: " << ctx->traverser->err_message ();
ctx->traverser->clear_err_message ();
}
goto done;
}
Expand Down

0 comments on commit 73222a7

Please sign in to comment.