XRootD
Loading...
Searching...
No Matches
XrdCl::Status Struct Reference

Procedure execution status. More...

#include <XrdClStatus.hh>

+ Inheritance diagram for XrdCl::Status:
+ Collaboration diagram for XrdCl::Status:

Public Member Functions

 Status (uint16_t st=stOK, uint16_t cod=errNone, uint32_t errN=0)
 Constructor.
 
int GetShellCode () const
 Get the status code that may be returned to the shell.
 
bool IsError () const
 Error.
 
bool IsFatal () const
 Fatal error.
 
bool IsOK () const
 We're fine.
 
std::string ToString () const
 Create a string representation.
 

Static Public Member Functions

static bool IsSocketError (uint16_t code)
 

Public Attributes

uint16_t code
 Error type, or additional hints on what to do.
 
uint32_t errNo
 Errno, if any.
 
uint16_t status
 Status of the execution.
 

Detailed Description

Procedure execution status.

Definition at line 114 of file XrdClStatus.hh.

Constructor & Destructor Documentation

◆ Status()

XrdCl::Status::Status ( uint16_t st = stOK,
uint16_t cod = errNone,
uint32_t errN = 0 )
inline

Constructor.

Definition at line 119 of file XrdClStatus.hh.

119 :
120 status(st), code(cod), errNo( errN ) {}
uint16_t code
Error type, or additional hints on what to do.
uint16_t status
Status of the execution.
uint32_t errNo
Errno, if any.

Member Function Documentation

◆ GetShellCode()

int XrdCl::Status::GetShellCode ( ) const
inline

Get the status code that may be returned to the shell.

Definition at line 129 of file XrdClStatus.hh.

130 {
131 if( IsOK() )
132 return 0;
133 return (code/100)+50;
134 }
bool IsOK() const
We're fine.

References code, and IsOK().

Referenced by ExecuteCommand(), and main().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsError()

bool XrdCl::Status::IsError ( ) const
inline

Error.

Definition at line 122 of file XrdClStatus.hh.

References status, and XrdCl::stError.

◆ IsFatal()

bool XrdCl::Status::IsFatal ( ) const
inline

Fatal error.

Definition at line 123 of file XrdClStatus.hh.

References status, and XrdCl::stFatal.

Referenced by XrdCl::Stream::OnConnectError(), and ToString().

+ Here is the caller graph for this function:

◆ IsOK()

bool XrdCl::Status::IsOK ( ) const
inline

We're fine.

Definition at line 124 of file XrdClStatus.hh.

References status, and XrdCl::stOK.

Referenced by XrdCl::ZipCache::ZipCache(), XrdPosixFile::~XrdPosixFile(), XrdCl::AssureFile(), XrdCl::Stream::CanCollapse(), XrdCl::Utils::CheckTPC(), XrdCl::Utils::CheckTPCLite(), XrdCl::FileSystem::ChMod(), XrdCl::EcHandler::Close(), XrdCl::FileStateHandler::Close(), XrdCl::File::Close(), XrdEc::StrmWriter::Close(), XrdPosixFile::Close(), XrdCl::ZipArchive::CloseArchive(), XrdCl::Socket::Connect(), XrdCl::Tls::Connect(), XrdCl::AsyncSocketHandler::Connect(), XrdCl::MessageUtils::CreateXAttrBody(), XrdCl::FileSystem::DeepLocate(), XrdCl::FileSystem::DelXAttr(), XrdCl::File::DelXAttr(), XrdCl::FileSystem::DirList(), XrdCl::FileSystem::DirList(), DoCache(), DoCat(), DoCD(), DoChMod(), DoLocate(), DoLS(), DoMkDir(), DoMv(), DoPrepare(), DoQuery(), DoRm(), DoRmDir(), DoSpaceInfo(), DoStat(), DoStatVFS(), DoTail(), DoTruncate(), DoXAttr(), XrdCl::Stream::EnableLink(), ProgressDisplay::EndJob(), ExecuteCommand(), ExecuteInteractive(), XrdPosixAdmin::FanOut(), XrdCl::File::Fcntl(), XrdCl::Socket::Flash(), XrdCl::Stream::ForceConnect(), XrdCl::XRootDTransport::GetBody(), XrdCl::GetEcHandler(), XrdCl::XRootDTransport::GetHeader(), XrdCl::XRootDTransport::GetMore(), XrdCl::Utils::GetProtocolVersion(), XrdCl::Utils::GetRemoteCheckSum(), XrdCl::GetResponse(), GetShellCode(), XrdCl::FileSystemUtils::GetSpaceInfo(), XrdCl::Utils::GetSupportedCheckSums(), XrdCl::FileSystem::GetXAttr(), XrdCl::File::GetXAttr(), XrdCl::AsyncSocketHandler::HandleHandShake(), XrdCl::PgReadSubstitutionHandler::HandleResponse(), XrdPosixFileRH::HandleResponse(), XrdPosixFile::HandleResponse(), XrdCl::ZipListHandler::HandleResponse(), XrdCl::EcPgReadResponseHandler::HandleResponse(), XrdCl::MetalinkReadHandler::HandleResponse(), XrdCl::UnpackXAttrStatus::HandleResponse(), XrdCl::FutureWrapper< Response >::HandleResponse(), XrdCl::FutureWrapper< void >::HandleResponse(), XrdCl::ChunkHandler::HandleResponse(), XrdCl::AssignLBHandler::HandleResponseWithHosts(), XrdCl::AssignLastURLHandler::HandleResponseWithHosts(), XrdCl::MetalinkOpenHandler::HandleResponseWithHosts(), XrdCl::ExOpenFuncWrapper::HandleResponseWithHosts(), IndexRemote(), XrdCl::Socket::Initialize(), XrdCl::XRootDMsgHandler::InspectStatusRsp(), XrdCl::FileSystem::ListXAttr(), XrdCl::File::ListXAttr(), XrdCl::MetalinkRedirector::Load(), XrdCl::FileSystem::Locate(), main(), main(), XrdCl::FileSystem::MkDir(), XrdCl::FileSystem::Mv(), XrdCl::Stream::OnConnect(), XrdCl::Stream::OnConnectError(), XrdCl::AsyncSocketHandler::OnConnectionReturn(), XrdCl::Stream::OnError(), XrdCl::FileStateHandler::OnOpen(), XrdCl::AsyncSocketHandler::OnRead(), XrdCl::Stream::OnReadTimeout(), XrdCl::AsyncSocketHandler::OnReadWhileHandshaking(), XrdCl::FileStateHandler::OnStateError(), XrdCl::XRootDMsgHandler::OnStatusReady(), XrdCl::AsyncSocketHandler::OnTLSHandShake(), XrdCl::AsyncSocketHandler::OnWrite(), XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking(), xrdcl_proxy::ProxyPrefixFile::Open(), XrdCl::File::Open(), XrdCl::LocalFileHandler::Open(), XrdCl::FileStateHandler::Open(), XrdCl::EcHandler::Open(), XrdCl::ZipArchive::OpenArchive(), XrdCl::FileStateHandler::PgRead(), XrdCl::File::PgRead(), XrdPosixFile::pgRead(), XrdCl::FileStateHandler::PgReadRetry(), XrdPosixFile::pgWrite(), XrdCl::FileStateHandler::PgWrite(), XrdCl::File::PgWrite(), XrdPosixFile::pgWrite(), XrdCl::FileSystem::Ping(), XrdCl::CopyProcess::Prepare(), XrdCl::FileSystem::Prepare(), XrdCl::XRootDMsgHandler::Process(), XrdCl::Utils::ProcessConfigDir(), XrdCl::FileSystem::Protocol(), XrdSsiSessReal::Provision(), XrdCl::FileSystem::Query(), XrdCl::AsyncHSReader::Read(), XrdCl::AsyncMsgReader::Read(), XrdPosixFile::Read(), XrdCl::Tls::Read(), XrdCl::AsyncRawReader::Read(), XrdCl::AsyncVectorReader::Read(), XrdEc::Reader::Read(), XrdCl::File::Read(), XrdPosixFile::Read(), XrdCl::AsyncRawReaderIntfc::ReadBytesAsync(), XrdPosixFile::ReadV(), XrdCl::File::ReadV(), XrdPosixFile::ReadV(), XrdCl::MessageUtils::RedirectMessage(), XrdCl::RedirectorRegistry::RegisterAndWait(), XrdPosixMap::Result(), XrdCl::FileSystem::Rm(), XrdCl::FileSystem::RmDir(), XrdCl::CopyProcess::Run(), XrdCl::ClassicCopyJob::Run(), XrdCl::ThirdPartyCopyJob::Run(), XrdCl::TPFallBackCopyJob::Run(), XrdCl::Operation< HasHndl >::Run(), XrdCl::SetXAttrImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrImpl< HasHndl >::RunImpl(), XrdCl::SetXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::GetXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::DelXAttrFsImpl< HasHndl >::RunImpl(), XrdCl::OpenFileImpl< HasHndl >::RunImpl(), XrdCl::CloseFileImpl< HasHndl >::RunImpl(), XrdCl::ZipStatImpl< HasHndl >::RunImpl(), XrdCl::ZipListImpl< HasHndl >::RunImpl(), XrdCl::Tls::Send(), XrdCl::Socket::Send(), XrdCl::Stream::Send(), XrdCl::FileSystemData::Send(), XrdCl::FileSystem::SendCache(), XrdCl::FileSystem::SendInfo(), XrdCl::MessageUtils::SendMessage(), XrdSsiTaskReal::SetBuff(), XrdSsiTaskReal::SetBuff(), XrdCl::FileSystem::SetXAttr(), XrdCl::File::SetXAttr(), XrdCl::File::Stat(), XrdCl::FileSystem::Stat(), XrdPosixAdmin::Stat(), XrdPosixAdmin::Stat(), XrdPosixFile::Stat(), XrdCl::FileSystem::StatVFS(), XrdCl::File::Sync(), XrdPosixFile::Sync(), ToString(), XrdCl::FileSystem::Truncate(), XrdCl::File::Truncate(), XrdSsiSessReal::Unprovision(), XrdCl::File::VectorRead(), XrdCl::File::VectorWrite(), XrdCl::File::Visa(), XrdCl::MessageUtils::WaitForResponse(), XrdCl::ResponseHandler::Wrap(), XrdCl::ResponseHandler::Wrap(), XrdCl::AsyncHSWriter::Write(), XrdCl::AsyncMsgWriter::Write(), XrdPosixFile::Write(), XrdCl::FileStateHandler::Write(), XrdEc::StrmWriter::Write(), XrdCl::File::Write(), XrdCl::File::Write(), XrdCl::File::Write(), XrdPosixFile::Write(), XrdCl::XRootDMsgHandler::WriteMessageBody(), XrdCl::File::WriteV(), XrdSsiSessReal::XeqEvent(), XrdSsiTaskReal::XeqEvent(), and XrdFfsPosix_mkdir().

◆ IsSocketError()

static bool XrdCl::Status::IsSocketError ( uint16_t code)
inlinestatic

Definition at line 136 of file XrdClStatus.hh.

137 {
138 return int( code / 100 ) == 1;
139 }

References code.

◆ ToString()

std::string XrdCl::Status::ToString ( ) const

Create a string representation.

Definition at line 97 of file XrdClStatus.cc.

98 {
99 std::ostringstream o;
100
101 //--------------------------------------------------------------------------
102 // The status is OK
103 //--------------------------------------------------------------------------
104 if( IsOK() )
105 {
106 o << "[SUCCESS] ";
107
108 if( code == suContinue )
109 o << "Continue";
110 else if( code == suRetry )
111 o << "Retry";
112
113 return o.str();
114 }
115
116 //--------------------------------------------------------------------------
117 // We have an error
118 //--------------------------------------------------------------------------
119 if( IsFatal() )
120 o << "[FATAL] ";
121 else
122 o << "[ERROR] ";
123
124 o << GetErrorMessage( code );
125
126 //--------------------------------------------------------------------------
127 // Add errno
128 //--------------------------------------------------------------------------
129 if( errNo >= kXR_ArgInvalid ) // kXR_ArgInvalid is the first (lowest) xrootd error code
130 // it is used in an inconsistent way sometimes it is
131 // xrootd error code and sometimes it is a plain errno
132 o << ": " << XrdSysE2T( XProtocol::toErrno( errNo ) );
133 else if ( errNo )
134 o << ": " << XrdSysE2T( errNo );
135
136 return o.str();
137 }
@ kXR_ArgInvalid
Definition XProtocol.hh:990
const char * XrdSysE2T(int errcode)
Definition XrdSysE2T.cc:104
static int toErrno(int xerr)
const uint16_t suRetry
const uint16_t suContinue
bool IsFatal() const
Fatal error.

References code, errNo, IsFatal(), IsOK(), kXR_ArgInvalid, XrdCl::suContinue, XrdCl::suRetry, XProtocol::toErrno(), and XrdSysE2T().

Referenced by XrdCl::AssureFile(), XrdPosixXrootd::Close(), XrdCl::ZipArchive::CloseArchive(), XrdCl::AsyncSocketHandler::Connect(), XrdPosixFile::DelayedDestroy(), XrdCl::Stream::ForceError(), main(), XrdCl::Stream::OnError(), XrdCl::AsyncSocketHandler::OnFault(), XrdCl::AsyncSocketHandler::OnFaultWhileHandshaking(), XrdCl::ZipArchive::OpenArchive(), XrdCl::XRootDMsgHandler::Process(), XrdCl::Utils::ProcessConfigDir(), XrdCl::MessageUtils::RedirectMessage(), XrdCl::ClassicCopyJob::Run(), XrdCl::MessageUtils::SendMessage(), XrdCl::XRootDStatus::ToStr(), and XrdCl::Action::ToString().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ code

uint16_t XrdCl::Status::code

Error type, or additional hints on what to do.

Definition at line 147 of file XrdClStatus.hh.

Referenced by XrdCl::FileStateHandler::Close(), XrdCl::File::Close(), XrdCl::Socket::ConnectToAddress(), XrdCl::FileSystem::DirList(), DoLocate(), DoLS(), DoSpaceInfo(), XrdCl::AsyncSocketHandler::DoTlsHandShake(), Fatal(), XrdCl::PropertyList::Get(), XrdCl::XRootDTransport::GetBody(), XrdSsiUtils::GetErr(), XrdCl::XRootDTransport::GetHeader(), XrdCl::XRootDTransport::GetMore(), GetShellCode(), XrdCl::FileSystemUtils::GetSpaceInfo(), XrdCl::AsyncSocketHandler::HandleHandShake(), XrdCl::AssignLBHandler::HandleResponseWithHosts(), XrdCl::AssignLastURLHandler::HandleResponseWithHosts(), XrdCl::XRootDMsgHandler::InspectStatusRsp(), IsSocketError(), XrdCl::AsyncSocketHandler::OnConnectionReturn(), XrdCl::AsyncSocketHandler::OnRead(), XrdCl::AsyncSocketHandler::OnReadWhileHandshaking(), XrdCl::FileStateHandler::OnStateError(), XrdCl::AsyncSocketHandler::OnTLSHandShake(), XrdCl::AsyncSocketHandler::OnWrite(), XrdCl::AsyncSocketHandler::OnWriteWhileHandshaking(), XrdCl::LocalFileHandler::Open(), XrdCl::AsyncHSReader::Read(), XrdCl::AsyncMsgReader::Read(), XrdCl::AsyncRawReader::Read(), XrdCl::AsyncVectorReader::Read(), XrdCl::AsyncRawReaderIntfc::ReadBytesAsync(), XrdPosixMap::Result(), XrdCl::ClassicCopyJob::Run(), XrdCl::TPFallBackCopyJob::Run(), XrdCl::Socket::Send(), XrdCl::PropertyList::Set(), XrdSsiUtils::SetErr(), XrdCl::XRootDStatus::ToStr(), ToString(), XrdCl::ResponseHandler::Wrap(), XrdCl::ResponseHandler::Wrap(), XrdCl::AsyncHSWriter::Write(), XrdCl::AsyncMsgWriter::Write(), and XrdCl::XRootDMsgHandler::WriteMessageBody().

◆ errNo

◆ status


The documentation for this struct was generated from the following files: