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
30  << "std::bad_alloc exception caught in " << programName << "\n"
31  << "The job has probably exhausted the virtual memory available to "
32  "the process.";
33  LogSystem(shortDesc) << longDesc.str();
34  }
35  catch (...) {
36  }
37 
38  void
39  printStdException(std::exception const& e, char const* prog) try {
40  std::string programName(prog ? prog : "program");
41  std::string shortDesc("StdLibException");
42  std::ostringstream longDesc;
43  longDesc << "Standard library exception caught in " << programName << "\n"
44  << cet::trim_right_copy(e.what(), " \n");
45  LogSystem(shortDesc) << longDesc.str();
46  }
47  catch (...) {
48  }
49 
50  void
51  printUnknownException(char const* prog) try {
52  std::string programName(prog ? prog : "program");
53  std::string shortDesc("UnknownException");
54  std::ostringstream longDesc;
55  longDesc << "Unknown exception caught in " << programName;
56  LogSystem(shortDesc) << longDesc.str();
57  }
58  catch (...) {
59  }
60 
61 } // namespace art
std::string string
Definition: nybbler.cc:12
void printStdException(std::exception const &e, char const *prog)
std::string trim_right_copy(std::string source, std::string const &t=" ")
Definition: trim.h:54
void printUnknownException(char const *prog)
const double e
MaybeLogger_< ELseverityLevel::ELsev_severe, false > LogSystem
void printArtException(cet::exception const &e, char const *prog)
void printBadAllocException(char const *prog)
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33