Skip to content
Snippets Groups Projects
Commit ccee5ae5 authored by Steven Murray's avatar Steven Murray
Browse files

Replaced calls to XRootDStatus::GetErrorMessage() with ToStr() for better error messages

parent 816c39fa
Branches
Tags
No related merge requests found
...@@ -129,7 +129,7 @@ int sendCommand(const int argc, const char **argv) { ...@@ -129,7 +129,7 @@ int sendCommand(const int argc, const char **argv) {
{ {
const XrdCl::XRootDStatus openStatus = xrootFile.Open(cmdPath, XrdCl::OpenFlags::Read); const XrdCl::XRootDStatus openStatus = xrootFile.Open(cmdPath, XrdCl::OpenFlags::Read);
if(!openStatus.IsOK()) { if(!openStatus.IsOK()) {
throw std::runtime_error(std::string("Failed to open ") + cmdPath + ": " + openStatus.GetErrorMessage()); throw std::runtime_error(std::string("Failed to open ") + cmdPath + ": " + openStatus.ToStr());
} }
} }
...@@ -141,7 +141,7 @@ int sendCommand(const int argc, const char **argv) { ...@@ -141,7 +141,7 @@ int sendCommand(const int argc, const char **argv) {
const XrdCl::XRootDStatus readStatus = xrootFile.Read(readOffset, 1, &rc_char, bytesRead); const XrdCl::XRootDStatus readStatus = xrootFile.Read(readOffset, 1, &rc_char, bytesRead);
if(!readStatus.IsOK()) { if(!readStatus.IsOK()) {
throw std::runtime_error(std::string("Failed to read first byte from ") + cmdPath + ": " + throw std::runtime_error(std::string("Failed to read first byte from ") + cmdPath + ": " +
readStatus.GetErrorMessage()); readStatus.ToStr());
} }
if(bytesRead != 1) { if(bytesRead != 1) {
throw std::runtime_error(std::string("Failed to read first byte from ") + cmdPath + throw std::runtime_error(std::string("Failed to read first byte from ") + cmdPath +
...@@ -161,7 +161,7 @@ int sendCommand(const int argc, const char **argv) { ...@@ -161,7 +161,7 @@ int sendCommand(const int argc, const char **argv) {
memset(buf, 0, sizeof(buf)); memset(buf, 0, sizeof(buf));
const XrdCl::XRootDStatus readStatus = xrootFile.Read(readOffset, sizeof(buf - 1), buf, bytesRead); const XrdCl::XRootDStatus readStatus = xrootFile.Read(readOffset, sizeof(buf - 1), buf, bytesRead);
if(!readStatus.IsOK()) { if(!readStatus.IsOK()) {
throw std::runtime_error(std::string("Failed to read ") + cmdPath + ": " + readStatus.GetErrorMessage()); throw std::runtime_error(std::string("Failed to read ") + cmdPath + ": " + readStatus.ToStr());
} }
if(bytesRead > 0) { if(bytesRead > 0) {
...@@ -180,7 +180,7 @@ int sendCommand(const int argc, const char **argv) { ...@@ -180,7 +180,7 @@ int sendCommand(const int argc, const char **argv) {
{ {
const XrdCl::XRootDStatus closeStatus = xrootFile.Close(); const XrdCl::XRootDStatus closeStatus = xrootFile.Close();
if(!closeStatus.IsOK()) { if(!closeStatus.IsOK()) {
throw std::runtime_error(std::string("Failed to close ") + cmdPath + ": " + closeStatus.GetErrorMessage()); throw std::runtime_error(std::string("Failed to close ") + cmdPath + ": " + closeStatus.ToStr());
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment