Classes | Namespaces | Macros | Enumerations | Functions | Variables
err_hnd.h File Reference

Error handling classes, o2scl::err_hnd_type and o2scl::err_hnd_gsl. More...

#include <iostream>
#include <string>

Go to the source code of this file.

Classes

class  o2scl::err_hnd_type
 Class defining an error handler [abstract base]. More...
 
class  o2scl::err_hnd_gsl
 The error handler. More...
 

Namespaces

 o2scl
 The main O2scl namespace.
 

Macros

#define O2SCL_ERR(d, n)   o2scl::set_err_fn(d,__FILE__,__LINE__,n);
 Set an error with message d and code n.
 
#define O2SCL_CONV(d, n, b)   {if (b) o2scl::set_err_fn(d,__FILE__,__LINE__,n);}
 Set a "convergence" error.
 
#define O2SCL_ERR2(d, d2, n)
 Set an error, two-string version. More...
 
#define O2SCL_CONV2(d, d2, n, b)
 Set a "convergence" error, two-string version. More...
 
#define O2SCL_CONV_RET(d, n, b)
 Set a "convergence" error and return the error value. More...
 
#define O2SCL_CONV2_RET(d, d2, n, b)
 Set an error and return the error value, two-string version. More...
 

Enumerations

enum  {
  o2scl::success =0, o2scl::gsl_failure =-1, o2scl::gsl_continue =-2, o2scl::exc_edom =1,
  o2scl::exc_erange =2, o2scl::exc_efault =3, o2scl::exc_einval =4, o2scl::exc_efailed =5,
  o2scl::exc_efactor =6, o2scl::exc_esanity =7, o2scl::exc_enomem =8, o2scl::exc_ebadfunc =9,
  o2scl::exc_erunaway =10, o2scl::exc_emaxiter =11, o2scl::exc_ezerodiv =12, o2scl::exc_ebadtol =13,
  o2scl::exc_etol =14, o2scl::exc_eundrflw =15, o2scl::exc_eovrflw =16, o2scl::exc_eloss =17,
  o2scl::exc_eround =18, o2scl::exc_ebadlen =19, o2scl::exc_enotsqr =20, o2scl::exc_esing =21,
  o2scl::exc_ediverge =22, o2scl::exc_eunsup =23, o2scl::exc_eunimpl =24, o2scl::exc_ecache =25,
  o2scl::exc_etable =26, o2scl::exc_enoprog =27, o2scl::exc_enoprogj =28, o2scl::exc_etolf =29,
  o2scl::exc_etolx =30, o2scl::exc_etolg =31, o2scl::exc_eof =32, o2scl::exc_enotfound =33,
  o2scl::exc_ememtype =34, o2scl::exc_efilenotfound =35, o2scl::exc_eindex =36, o2scl::exc_outsidecons =37
}
 The integer error definitions. More...
 

Functions

void o2scl::error_update (int &ret, int err)
 Update an error value err with the value in ret. More...
 
The error handler function
void o2scl::set_err_fn (const char *desc, const char *file, int line, int errnum)
 Call the error handler.
 

Variables

err_hnd_type * o2scl::err_hnd
 The global error handler pointer.
 
err_hnd_gsl o2scl::alt_err_hnd
 An alternate GSL-like error handler.
 

Detailed Description

See also exception.h .

Definition in file err_hnd.h.

Macro Definition Documentation

◆ O2SCL_CONV2

#define O2SCL_CONV2 (   d,
  d2,
  n,
 
)
Value:
{if (b) \
o2scl::set_err_fn((std::string(d)+d2).c_str(), \
__FILE__,__LINE__,n);}
void set_err_fn(const char *desc, const char *file, int line, int errnum)
Call the error handler.
Definition: err_hnd.h:307

Definition at line 286 of file err_hnd.h.

◆ O2SCL_CONV2_RET

#define O2SCL_CONV2_RET (   d,
  d2,
  n,
 
)
Value:
do { if (!b) { return n; } else { \
o2scl::set_err_fn((std::string(d)+d2).c_str(), \
__FILE__,__LINE__,n); return n; } } while (0)
void set_err_fn(const char *desc, const char *file, int line, int errnum)
Call the error handler.
Definition: err_hnd.h:307

Definition at line 298 of file err_hnd.h.

◆ O2SCL_CONV_RET

#define O2SCL_CONV_RET (   d,
  n,
 
)
Value:
do { if (!b) { return n; } else { \
o2scl::set_err_fn(d,__FILE__,__LINE__,n); return n; } } while (0)
void set_err_fn(const char *desc, const char *file, int line, int errnum)
Call the error handler.
Definition: err_hnd.h:307

Definition at line 292 of file err_hnd.h.

◆ O2SCL_ERR2

#define O2SCL_ERR2 (   d,
  d2,
 
)
Value:
o2scl::set_err_fn((std::string(d)+d2).c_str(), \
__FILE__,__LINE__,n);
void set_err_fn(const char *desc, const char *file, int line, int errnum)
Call the error handler.
Definition: err_hnd.h:307

Definition at line 281 of file err_hnd.h.

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).