72 int n = message.length();
75 m_str =
new char[n+1];
78 for (std::size_t i = 0; i < n; ++i) {
79 m_str[i] = message[i];
97 const std::string& message)
104 if (message.length() > 0) {
120 const std::string& message)
127 if (message.length() > 0) {
146 const std::string& argument,
147 const std::string& message)
153 m_message =
"Invalid argument \""+argument+
"\" value.";
156 if (message.length() > 0) {
172 const std::string& message)
179 if (message.length() > 0) {
202 const std::string&
what,
205 const std::string& message)
217 m_message =
"Invalid access to empty object with " +
221 if (message.length() > 0) {
237 const std::string& message)
244 if (message.length() > 0) {
262 const std::string& message)
274 if (message.length() > 0) {
290 const std::string& message)
297 if (message.length() > 0) {
316 const std::string& message)
322 if (message.length() > 0) {
328 m_message +=
" In case that you need this feature for your application"
329 " please submit a feature request on"
330 " https://cta-redmine.irap.omp.eu/projects/gammalib/,"
331 " join this error message and provide a detailed"
332 " description of your needs.";
346 const std::string& message)
350 m_message =
"Nested try error ("+message+
")";
365 const std::string& message)
369 m_message =
"Failure Test ("+message+
")";
384 const std::string& message)
413 std::string msg =
"Minimum energy "+emin.
print()+
" is equal to "
414 "maximum energy "+emax.
print()+
". Please specify "
415 "a minimum energy that is smaller than the maximum "
419 else if (emin > emax) {
420 std::string msg =
"Minimum energy "+emin.
print()+
" is larger than "
421 "maximum energy "+emax.
print()+
". Please specify a "
422 "minimum energy that is smaller than the maximum "
451 std::string msg =
"One invalid (x,y) coordinate specified. Please "
452 "make sure that only valid (x,y) coordinates "
458 "specified. Please make sure that only valid "
459 "(x,y) coordinates are specified.";
488 std::string msg =
"One invalid (phi,theta) coordinate specified. "
489 "Please make sure that only valid (phi,theta) "
490 "coordinates are specified.";
495 "coordinates specified. Please make sure that "
496 "only valid (phi,theta) coordinates are specified.";
Energy value class definition.
Exception handler interface definition.
CFITSIO interface header.
Class that handles energies in a unit independent way.
std::string print(const GChatter &chatter=NORMAL) const
Print energy.
GExceptionHandler()
Void constructor.
virtual const char * what() const
Exception message.
virtual ~GExceptionHandler()
Destructor.
std::string m_message
Exception message.
char * m_str
Message returned by what()
std::string m_origin
Method that threw exception.
feature_not_implemented(const std::string &origin, const std::string &message="")
Feature not implement.
file_error(const std::string &origin, const std::string &message="")
File error.
fits_error(const std::string &origin, const int &status, const std::string &message="")
General FITS error.
invalid_argument(const std::string &origin, const std::string &message)
Invalid argument.
invalid_return_value(const std::string &origin, const std::string &message)
Invalid return value.
invalid_value(const std::string &origin, const std::string &message)
Invalid value.
out_of_range(const std::string &origin, const std::string &what, const int &index, const int &elements, const std::string &message="")
Index is out of range [0,elements-1].
runtime_error(const std::string &origin, const std::string &message="")
Runtime error.
test_error(const std::string &origin, const std::string &message="")
Failure test.
test_failure(const std::string &origin, const std::string &message="")
Failure test.
test_nested_try_error(const std::string &origin, const std::string &message="")
Test nested try error.
void check_energy_interval(const std::string &origin, const GEnergy &emin, const GEnergy &emax)
Checks energy interval.
std::string number(const std::string &noun, const int &number)
Convert singular noun into number noun.
std::string str(const unsigned short int &value)
Convert unsigned short integer value into string.
std::string tolower(const std::string &s)
Convert string to lower case.
std::string strip_whitespace(const std::string &arg)
Strip leading and trailing whitespace from string.
void check_prj_s2x_status(const std::string &origin, const int &status, const int &number)
Checks status of GWcs::prj_s2x method.
void check_prj_x2s_status(const std::string &origin, const int &status, const int &number)
Checks status of GWcs::prj_x2s method.