TF++, Miscellaneous classes and modules in C++:
exception.cc
Go to the documentation of this file.
1 
34 #define TF_EXCEPTION_CC_VERSION \
35  "TF_EXCEPTION_CC V1.0"
36 
37 #include <iostream>
38 #include <tfxx/fs.h>
39 #include <tfxx/error.h>
40 #include <cstring>
41 
42 namespace tfxx {
43 
44  namespace error {
45 
46  FSException::FSException(const char* message,
47  const char* file,
48  const int& line,
49  const int& en):
50  TBase(message, file, line, "file system utility returned error"),
51  Merrno(en)
52  {
53  if (this->report_on_construct_is_true()) { this->fs_report(); }
54  }
55 
56  void FSException::report() const
57  {
58  TBase::report();
59  this->fs_report();
60  }
61 
63  {
64  std::cerr << " error value: " << Merrno << std::endl;
65  std::cerr << " " << strerror(Merrno) << std::endl;
66  }
67 
68  } // namespace error
69 
70 }
71 
72 /* ----- END OF exception.cc ----- */
virtual void report() const
Screen report.
Definition: exception.cc:56
bool report_on_construct_is_true() const
Definition: error.h:108
FSException(const char *message, const char *file, const int &line, const int &en)
Create with message, failed assertion, and code position.
Definition: exception.cc:46
void fs_report() const
my report
Definition: exception.cc:62
Base class for exceptions.
Definition: error.h:78
virtual void report() const
Screen report.
Definition: error.cc:108
Namespace containing all code of library libtfxx.
int Merrno
error number
Definition: fs.h:92