File indexing completed on 2023-03-17 11:03:53
0001 #include "FWCore/Utilities/interface/ConvertException.h"
0002 #include "FWCore/Utilities/interface/EDMException.h"
0003
0004 #include <iostream>
0005
0006 namespace edm {
0007
0008 void convertException::badAllocToEDM() {
0009 std::cerr << "\nstd::bad_alloc exception" << std::endl;
0010 edm::Exception e(edm::errors::BadAlloc);
0011 e << "A std::bad_alloc exception was thrown.\n"
0012 << "The job has probably exhausted the virtual memory available to the process.\n";
0013 throw e;
0014 }
0015
0016 void convertException::stdToEDM(std::exception const& e) {
0017 edm::Exception ex(edm::errors::StdException);
0018 ex << "A std::exception was thrown.\n" << e.what();
0019 throw ex;
0020 }
0021
0022 void convertException::stringToEDM(std::string& s) {
0023 edm::Exception e(edm::errors::BadExceptionType);
0024 e << "A std::string was thrown as an exception.\n" << s;
0025 throw e;
0026 }
0027
0028 void convertException::charPtrToEDM(char const* c) {
0029 edm::Exception e(edm::errors::BadExceptionType);
0030 e << "A const char* was thrown as an exception.\n" << c;
0031 throw e;
0032 }
0033
0034 void convertException::unknownToEDM() {
0035 edm::Exception e(edm::errors::Unknown);
0036 e << "An exception of unknown type was thrown.\n";
0037 throw e;
0038 }
0039 }