MCPcopy Create free account
hub / github.com/apache/brpc / SetFailed

Method SetFailed

src/brpc/controller.cpp:450–466  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

448}
449
450void 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
468void Controller::SetFailed(int error_code, const char* reason_fmt, ...) {
469 if (error_code == 0) {

Callers 2

OnCompleteMethod · 0.45
HandleSocketFailedMethod · 0.45

Calls 12

string_appendfFunction · 0.85
UpdateResponseHeaderFunction · 0.85
string_vappendfFunction · 0.85
set_error_codeMethod · 0.80
AnnotateMethod · 0.80
AnnotateCStrMethod · 0.80
emptyMethod · 0.45
push_backMethod · 0.45
appendMethod · 0.45
lockMethod · 0.45
sizeMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected