CCfits  2.6
FitsError.h
1 // Astrophysics Science Division,
2 // NASA/ Goddard Space Flight Center
3 // HEASARC
4 // http://heasarc.gsfc.nasa.gov
5 // e-mail: ccfits@legacy.gsfc.nasa.gov
6 //
7 // Original author: Ben Dorman
8 
9 #ifndef FITSERROR_H
10 #define FITSERROR_H 1
11 #include <exception>
12 #include <iostream>
13 //#include <exception>
14 //#include <iostream>
15 //#include <stl.h>
16 #include <string>
17 using std::string;
18 
19 
20 namespace CCfits {
21 
88  // Base class for exceptions generated by CCfits that don't
89  // return FITS error codes (for example, array errors or seek errors).
90 
91 
92 
94  {
95  public:
96  FitsException (const string& msg, bool& silent);
97 
98  const string& message () const;
99 
100  protected:
101  void addToMessage (const string& msgQual);
102 
103  private:
104  private: //## implementation
105  // Data Members for Class Attributes
106  string m_message;
107 
108  };
109 
110 
111 
112  class FitsError : public FitsException //## Inherits: <unnamed>%399170BD017D
113  {
114  public:
115  FitsError (int errornum, bool silent = true);
116 
117  protected:
118  private:
119  void printMsg (int error);
120 
121  private: //## implementation
122  };
123 
124 
125 
126  class FitsFatal
127  {
128  public:
129  FitsFatal (const string& diag);
130 
131  protected:
132  private:
133  private: //## implementation
134  };
135 
136  // Class CCfits::FitsException
137 
138  inline const string& FitsException::message () const
139  {
140  return m_message;
141  }
142 
143  // Class CCfits::FitsError
144 
145  // Class CCfits::FitsFatal
146 
147 } // namespace CCfits
148 
149 
150 #endif
FitsException(const string &msg, bool &silent)
Definition: FitsError.cxx:42
FitsError is the exception thrown by non-zero cfitsio status codes.
Definition: FitsError.h:112
FitsError(int errornum, bool silent=true)
ctor for cfitsio exception: translates status code into cfitsio error message
Definition: FitsError.cxx:23
FitsException is the base class for all exceptions thrown by this library.
Definition: FitsError.h:93
[potential] base class for exceptions to be thrown on internal library error.
Definition: FitsError.h:126
const string & message() const
returns the error message
Definition: FitsError.h:138
FitsFatal(const string &diag)
Prints a message starting &quot;*** CCfits Fatal Error: ...&quot; and calls terminate()
Definition: FitsError.cxx:63