LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ExceptionMessages.cc
Go to the documentation of this file.
2 #include "cetlib/trim.h"
3 #include "cetlib_except/exception.h"
5 
6 #include <sstream>
7 #include <string>
8 
9 using mf::LogSystem;
10 
11 namespace art {
12  void
13  printArtException(cet::exception const& e, char const* prog) try {
14  std::string programName(prog ? prog : "program");
15  std::string shortDesc("ArtException");
16  std::ostringstream longDesc;
17  longDesc << "cet::exception caught in " << programName << "\n"
18  << cet::trim_right_copy(e.explain_self(), " \n");
19  LogSystem(shortDesc) << longDesc.str();
20  }
21  catch (...) {
22  }
23 
24  void
25  printBadAllocException(char const* prog) try {
26  std::string programName(prog ? prog : "program");
27  std::string shortDesc("std::bad_allocException");
28  std::ostringstream longDesc;
29  longDesc << "std::bad_alloc exception caught in " << programName << "\n"
30  << "The job has probably exhausted the virtual memory available "
31  "to the process.";
32  LogSystem(shortDesc) << longDesc.str();
33  }
34  catch (...) {
35  }
36 
37  void
38  printStdException(std::exception const& e, char const* prog) try {
39  std::string programName(prog ? prog : "program");
40  std::string shortDesc("StdLibException");
41  std::ostringstream longDesc;
42  longDesc << "Standard library exception caught in " << programName << "\n"
43  << cet::trim_right_copy(e.what(), " \n");
44  LogSystem(shortDesc) << longDesc.str();
45  }
46  catch (...) {
47  }
48 
49  void
50  printUnknownException(char const* prog) try {
51  std::string programName(prog ? prog : "program");
52  std::string shortDesc("UnknownException");
53  std::ostringstream longDesc;
54  longDesc << "Unknown exception caught in " << programName;
55  LogSystem(shortDesc) << longDesc.str();
56  }
57  catch (...) {
58  }
59 
60 } // art
void printStdException(std::exception const &e, char const *prog)
void printUnknownException(char const *prog)
MaybeLogger_< ELseverityLevel::ELsev_severe, false > LogSystem
void printArtException(cet::exception const &e, char const *prog)
HLT enums.
void printBadAllocException(char const *prog)
Float_t e
Definition: plot.C:34
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33