Definition at line 22 of file XrdRequest.h.
void XrdAdaptor::ClientRequest::HandleResponse |
( |
XrdCl::XRootDStatus * |
status, |
|
|
XrdCl::AnyObject * |
response |
|
) |
| |
|
override |
Handle the response from the Xrootd server.
Definition at line 23 of file XrdRequest.cc.
24 std::unique_ptr<XrdCl::AnyObject> response(resp);
25 std::unique_ptr<XrdCl::XRootDStatus>
status(
stat);
36 XrdCl::ChunkInfo *read_info;
37 response->Get(read_info);
38 if (read_info ==
nullptr) {
40 ex <<
"nullptr returned from response->Get().";
41 ex.addContext(
"XrdAdaptor::ClientRequest::HandleResponse() called.");
42 m_promise.set_exception(std::make_exception_ptr(ex));
45 if (read_info->length == 0) {
48 <<
"\n received a read_info->length = 0 and read_info->offset = " << read_info->offset;
52 XrdCl::VectorReadInfo *read_info;
53 response->Get(read_info);
54 if (read_info ==
nullptr) {
56 ex <<
"nullptr returned from response->Get() from vector read.";
57 ex.addContext(
"XrdAdaptor::ClientRequest::HandleResponse() called.");
58 m_promise.set_exception(std::make_exception_ptr(ex));
61 if (read_info->GetSize() == 0) {
62 edm::LogWarning(
"XrdAdaptorInternal") <<
"XrdAdaptor::ClientRequest::HandleResponse: While reading from\n "
66 m_promise.set_value(read_info->GetSize());
71 <<
"XrdRequestManager::handle(name='" <<
m_manager.
getFilename() <<
") failure when reading from "
72 << (
source ?
source->PrettyID() :
"(unknown source)") <<
"; failed with error '" <<
status->ToStr()
73 <<
"' (errno=" <<
status->errNo <<
", code=" <<
status->code <<
").";
80 if (ex.
getCode() == XrdCl::errInvalidResponse) {
81 m_promise.set_exception(std::current_exception());
86 ex.
addContext(
"XrdAdaptor::ClientRequest::HandleResponse() failure while running connection recovery");
88 ss <<
"Original error: '" <<
status->ToStr() <<
"' (errno=" <<
status->errNo <<
", code=" <<
status->code
89 <<
", source=" << (
source ?
source->PrettyID() :
"(unknown source)") <<
").";
91 m_promise.set_exception(std::current_exception());
92 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a CMSSW exception when running connection recovery.";
96 <<
"' (errno=" <<
status->errNo <<
", code=" <<
status->code <<
"). Unknown exception occurred when running"
97 <<
" connection recovery.";
98 ex.
addContext(
"Calling XrdRequestManager::handle()");
101 m_promise.set_exception(std::make_exception_ptr(ex));
102 edm::LogWarning(
"XrdAdaptorInternal") <<
"Caught a new exception when running connection recovery.";
References cms::Exception::addAdditionalInfo(), cms::Exception::addContext(), cppFunctionSkipper::exception, FAKE_ERROR_COUNTER, edm::errors::FileReadError, g_fakeError, XrdAdaptor::XrootdException::getCode(), source, contentValuesCheck::ss, hgcalPlots::stat, mps_update::status, and XrdAdaptor::QualityMetricWatch::swap().