Skip to content

Commit

Permalink
Fix catching polymorphic type by value error
Browse files Browse the repository at this point in the history
  • Loading branch information
ellert committed Apr 12, 2018
1 parent 76c850f commit d5f8644
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/XrdCeph/XrdCephOss.cc
Expand Up @@ -70,7 +70,7 @@ extern "C"
// set parameters
try {
ceph_posix_set_defaults(parms);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephEroute.Say("CephOss loading failed with exception. Check the syntax of parameters : ", parms);
return 0;
}
Expand Down Expand Up @@ -193,7 +193,7 @@ int XrdCephOss::Stat(const char* path,
} else {
return ceph_posix_stat(env, path, buff);
}
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephEroute.Say("stat : invalid syntax in file parameters");
return -EINVAL;
}
Expand Down Expand Up @@ -228,7 +228,7 @@ int XrdCephOss::Truncate (const char* path,
XrdOucEnv* env) {
try {
return ceph_posix_truncate(env, path, size);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephEroute.Say("truncate : invalid syntax in file parameters");
return -EINVAL;
}
Expand All @@ -237,7 +237,7 @@ int XrdCephOss::Truncate (const char* path,
int XrdCephOss::Unlink(const char *path, int Opts, XrdOucEnv *env) {
try {
return ceph_posix_unlink(env, path);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephEroute.Say("unlink : invalid syntax in file parameters");
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCeph/XrdCephOssDir.cc
Expand Up @@ -38,7 +38,7 @@ int XrdCephOssDir::Opendir(const char *path, XrdOucEnv &env) {
return -errno;
}
return XrdOssOK;
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephEroute.Say("opendir : invalid syntax in file parameters");
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/XrdCeph/XrdCephOssFile.cc
Expand Up @@ -44,7 +44,7 @@ int XrdCephOssFile::Open(const char *path, int flags, mode_t mode, XrdOucEnv &en
if (rc < 0) return rc;
m_fd = rc;
return XrdOssOK;
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephEroute.Say("open : invalid syntax in file parameters");
return -EINVAL;
}
Expand Down
10 changes: 5 additions & 5 deletions src/XrdCeph/XrdCephXAttr.cc
Expand Up @@ -45,7 +45,7 @@ extern "C"
// set parameters
try {
ceph_posix_set_defaults(parms);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephXattrEroute.Say("CephXattr loading failed with exception. Check the syntax of parameters : ", parms);
return 0;
}
Expand All @@ -60,7 +60,7 @@ XrdCephXAttr::~XrdCephXAttr() {}
int XrdCephXAttr::Del(const char *Aname, const char *Path, int fd) {
try {
return ceph_posix_removexattr(0, Path, Aname);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephXattrEroute.Say("Del : invalid syntax in file parameters", Path);
return -EINVAL;
}
Expand All @@ -77,7 +77,7 @@ int XrdCephXAttr::Get(const char *Aname, void *Aval, int Avsz,
} else {
try {
return ceph_posix_getxattr(0, Path, Aname, Aval, Avsz);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephXattrEroute.Say("Get : invalid syntax in file parameters", Path);
return -EINVAL;
}
Expand All @@ -90,7 +90,7 @@ int XrdCephXAttr::List(AList **aPL, const char *Path, int fd, int getSz) {
} else {
try {
return ceph_posix_listxattrs(0, Path, aPL, getSz);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephXattrEroute.Say("List : invalid syntax in file parameters", Path);
return -EINVAL;
}
Expand All @@ -104,7 +104,7 @@ int XrdCephXAttr::Set(const char *Aname, const void *Aval, int Avsz,
} else {
try {
return ceph_posix_setxattr(0, Path, Aname, Aval, Avsz, 0);
} catch (std::exception e) {
} catch (std::exception &e) {
XrdCephXattrEroute.Say("Set : invalid syntax in file parameters", Path);
return -EINVAL;
}
Expand Down

0 comments on commit d5f8644

Please sign in to comment.