Skip to content

Commit

Permalink
Merge pull request #23678 from Dr15Jones/polymorphicException
Browse files Browse the repository at this point in the history
catch polymorphic exception by reference
  • Loading branch information
cmsbuild committed Jun 26, 2018
2 parents 73d2d0b + cd74c95 commit ae13862
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion DataFormats/Common/test/DetSetNew_t.cpp
Expand Up @@ -401,7 +401,7 @@ namespace {
std::copy(test.sv.begin(),test.sv.begin()+n,ff.begin());
if (ff.full()) { ff.abort(); aborted=true;}
else { ntot+=n; }
} catch (edmNew::CapacityExaustedException) {
} catch (edmNew::CapacityExaustedException const&) {
CPPUNIT_ASSERT("cannot be here"==0);
}
}
Expand Down
2 changes: 1 addition & 1 deletion FWCore/PythonParameterSet/src/MakeParameterSets.cc
Expand Up @@ -75,7 +75,7 @@ namespace edm {
makePSetsFromString(module,mainNamespace);
}
}
catch( error_already_set ) {
catch( error_already_set const& ) {
pythonToCppException("Configuration");
Py_Finalize();
}
Expand Down
2 changes: 1 addition & 1 deletion FWCore/PythonParameterSet/src/PythonProcessDesc.cc
Expand Up @@ -52,7 +52,7 @@ void PythonProcessDesc::read(std::string const& config) {
readString(config);
}
}
catch(error_already_set) {
catch(error_already_set const&) {
edm::pythonToCppException("Configuration");
Py_Finalize();
}
Expand Down
4 changes: 2 additions & 2 deletions FWCore/PythonParameterSet/src/pythonFileToConfigure.cc
Expand Up @@ -31,7 +31,7 @@ std::string edm::pythonFileToConfigure(const std::string& iPythonFileName)
Py_file_input,
main_namespace.ptr(),
main_namespace.ptr()))));
} catch(error_already_set) {
} catch(error_already_set const&) {
edm::pythonToCppException("Configuration");
}
try {
Expand All @@ -42,7 +42,7 @@ std::string edm::pythonFileToConfigure(const std::string& iPythonFileName)
main_namespace.ptr()))));
returnValue= extract<std::string>(result);

}catch( error_already_set ) {
}catch( error_already_set const& ) {
edm::pythonToCppException("Configuration");
}
}catch(...) {
Expand Down
2 changes: 1 addition & 1 deletion IOPool/Input/src/InputFile.cc
Expand Up @@ -105,7 +105,7 @@ namespace edm {
logFileAction(" Closed file ", fileName_.c_str());
Service<JobReport> reportSvc;
reportSvc->inputFileClosed(inputType_, reportToken_);
} catch(std::exception) {
} catch(std::exception const&) {
// If Close() called in a destructor after an exception throw, the services may no longer be active.
// Therefore, we catch any reasonable new exception.
}
Expand Down
38 changes: 19 additions & 19 deletions IOPool/TFileAdaptor/src/TStorageFactoryFile.cc
Expand Up @@ -11,7 +11,7 @@
#include "TSystem.h"
#include "TROOT.h"
#include "TEnv.h"
#include <errno.h>
#include <cerrno>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down Expand Up @@ -70,20 +70,20 @@ class TTreeCacheDebug : public TTreeCache {
#endif

ClassImp(TStorageFactoryFile)
static StorageAccount::Counter *s_statsCtor = 0;
static StorageAccount::Counter *s_statsOpen = 0;
static StorageAccount::Counter *s_statsClose = 0;
static StorageAccount::Counter *s_statsFlush = 0;
static StorageAccount::Counter *s_statsStat = 0;
static StorageAccount::Counter *s_statsSeek = 0;
static StorageAccount::Counter *s_statsRead = 0;
static StorageAccount::Counter *s_statsCRead = 0;
static StorageAccount::Counter *s_statsCPrefetch = 0;
static StorageAccount::Counter *s_statsARead = 0;
static StorageAccount::Counter *s_statsXRead = 0;
static StorageAccount::Counter *s_statsWrite = 0;
static StorageAccount::Counter *s_statsCWrite = 0;
static StorageAccount::Counter *s_statsXWrite = 0;
static StorageAccount::Counter *s_statsCtor = nullptr;
static StorageAccount::Counter *s_statsOpen = nullptr;
static StorageAccount::Counter *s_statsClose = nullptr;
static StorageAccount::Counter *s_statsFlush = nullptr;
static StorageAccount::Counter *s_statsStat = nullptr;
static StorageAccount::Counter *s_statsSeek = nullptr;
static StorageAccount::Counter *s_statsRead = nullptr;
static StorageAccount::Counter *s_statsCRead = nullptr;
static StorageAccount::Counter *s_statsCPrefetch = nullptr;
static StorageAccount::Counter *s_statsARead = nullptr;
static StorageAccount::Counter *s_statsXRead = nullptr;
static StorageAccount::Counter *s_statsWrite = nullptr;
static StorageAccount::Counter *s_statsCWrite = nullptr;
static StorageAccount::Counter *s_statsXWrite = nullptr;


static inline StorageAccount::Counter &
Expand Down Expand Up @@ -207,7 +207,7 @@ TStorageFactoryFile::Initialize(const char *path,
if (statsService.isAvailable()) {
statsService->setSize(storage_->size());
}
} catch (edm::Exception e) {
} catch (edm::Exception const& e) {
if (e.categoryCode() != edm::errors::NotFound) {
throw;
}
Expand Down Expand Up @@ -278,7 +278,7 @@ TStorageFactoryFile::ReadBuffer(char *buf, Int_t len)
? storageCounter(s_statsCPrefetch, StorageAccount::Operation::readPrefetchToCache)
: storageCounter(s_statsCRead, StorageAccount::Operation::readViaCache));

Int_t st = ReadBufferViaCache(async ? 0 : buf, len);
Int_t st = ReadBufferViaCache(async ? nullptr : buf, len);

if (st == 2) {
Error("ReadBuffer","ReadBufferViaCache failed. Asked to read nBytes: %d from offset: %lld with file size: %lld",len, here, GetSize());
Expand Down Expand Up @@ -349,7 +349,7 @@ TStorageFactoryFile::ReadBufferAsync(Long64_t off, Int_t len)
;
}

IOPosBuffer iov(off, (void *) 0, len ? len : PREFETCH_PROBE_LENGTH);
IOPosBuffer iov(off, (void *) nullptr, len ? len : PREFETCH_PROBE_LENGTH);
if (storage_->prefetch(&iov, 1))
{
stats.tick(len);
Expand Down Expand Up @@ -459,7 +459,7 @@ TStorageFactoryFile::ReadBuffers(char *buf, Long64_t *pos, Int_t *len, Int_t nbu
// optimization itself.

// Read from underlying storage.
void* const nobuf = 0;
void* const nobuf = nullptr;
Int_t total = 0;
std::vector<IOPosBuffer> iov;
iov.reserve(nbuf);
Expand Down
2 changes: 1 addition & 1 deletion Utilities/XrdAdaptor/src/XrdRequest.cc
Expand Up @@ -104,7 +104,7 @@ XrdAdaptor::ClientRequest::HandleResponse(XrdCl::XRootDStatus *stat, XrdCl::AnyO
m_promise.set_exception(std::current_exception());
edm::LogWarning("XrdAdaptorInternal") << "Caught a CMSSW exception when running connection recovery.";
}
catch (std::exception)
catch (std::exception const&)
{
edm::Exception ex(edm::errors::FileReadError);
ex << "XrdRequestManager::handle(name='" << m_manager.getFilename()
Expand Down

0 comments on commit ae13862

Please sign in to comment.