Copilot commented on code in PR #13032:
URL: https://github.com/apache/trafficserver/pull/13032#discussion_r4132664171
##########
src/traffic_ctl/CtrlCommands.cc:
##########
@@ -1243,14 +1266,21 @@ ServerCommand::server_debug()
lookup_request.emplace_rec("proxy.config.diags.debug.tags",
shared::rpc::NOT_REGEX, shared::rpc::CONFIG_REC_TYPES);
auto lookup_response = invoke_rpc(lookup_request);
- if (!lookup_response.is_error()) {
- auto const &records =
lookup_response.result.as<shared::rpc::RecordLookUpResponse>();
- if (!records.recordList.empty()) {
- std::string current_tags = records.recordList[0].currentValue;
- if (!current_tags.empty()) {
- // Combine: current|new
- tags = current_tags + "|" + tags;
- }
+ if (lookup_response.is_error()) {
+ // Without the current tags the append cannot be done: report it and set
nothing.
+ _printer->write_output(lookup_response);
+ if (App_Exit_Status_Code == CTRL_EX_OK) {
+ App_Exit_Status_Code = CTRL_EX_ERROR;
+ }
Review Comment:
`BasePrinter::write_output()` has already graded this `ExecutionError`; for
a warning below `--error-level` it deliberately leaves `App_Exit_Status_Code`
at 0. This unconditional override makes `server debug --append` the one decoded
command that still exits 2 for a below-threshold handler warning (and makes
`--error-level=fatal` ineffective), contrary to the option's stated contract.
Let the printer's grade stand here; protocol/non-handler errors are already
graded as 2.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]