| 448 | } |
| 449 | |
| 450 | void Controller::SetFailed(const std::string& reason) { |
| 451 | _error_code = -1; |
| 452 | if (!_error_text.empty()) { |
| 453 | _error_text.push_back(' '); |
| 454 | } |
| 455 | if (_current_call.nretry != 0) { |
| 456 | butil::string_appendf(&_error_text, "[R%d]", _current_call.nretry); |
| 457 | } else { |
| 458 | AppendServerIdentiy(); |
| 459 | } |
| 460 | _error_text.append(reason); |
| 461 | if (auto span = _span.lock()) { |
| 462 | span->set_error_code(_error_code); |
| 463 | span->Annotate(reason); |
| 464 | } |
| 465 | UpdateResponseHeader(this); |
| 466 | } |
| 467 | |
| 468 | void Controller::SetFailed(int error_code, const char* reason_fmt, ...) { |
| 469 | if (error_code == 0) { |
no test coverage detected