mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
Error Handling Macros

Macros controlling how mxlib reports errors

mxlib components use these macros to report errors to the user, which by default are wrappers for mx::error_report and mx::errno_report. This behavior can be changed with preprocessor defines.

To completely suppress all mxlib error reporting, include the following before includng any mxlib headers

#define MX_NO_ERROR_REPORTS

Macros

#define mxError(esrc, ecode, expl)
 This reports an mxlib specific error.

Macro Definition Documentation

◆ mxError

#define mxError ( esrc,
ecode,
expl )
Value:
std::cerr << "\n" << mx::error_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
error_t error_report(const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
Print a report to stderr given an mxlib error_t code and explanation and return the code.
Definition error.hpp:540

This reports an mxlib specific error.

Can be predefined to change the error reporting of mxlib.

Parameters
[in]esrcis intended to identify the component (i.e. the class name)
[in]ecodeis an errno erro code
[in]expl[optional] if more information can be provided, use this to inform the user.

Definition at line 78 of file mxErrorOld.hpp.

Referenced by mx::AO::sim::generalIntegrator< _realT >::closingGains(), mx::astro::cahoySpectrumRaw< _units >::fileName(), mx::AO::sim::generalIntegrator< _realT >::gain(), mx::AO::sim::generalIntegrator< _realT >::gain(), mx::AO::sim::leakyIntegrator< _realT >::gain(), mx::AO::sim::leakyIntegrator< _realT >::gain(), mx::AO::sim::generalIntegrator< _realT >::gains(), mx::AO::sim::generalIntegrator< _realT >::gains(), mx::AO::sim::leakyIntegrator< _realT >::gains(), mx::AO::sim::leakyIntegrator< _realT >::gains(), mx::wfp::idealCoronagraph< _realT >::loadCoronagraph(), mx::wfp::lyotCoronagraph< _realT, _fpmaskFloatT >::loadCoronagraph(), mx::astro::cahoyGrid< _units >::loadGrid(), mx::wfp::idealCoronagraph< _realT >::propagate(), mx::wfp::idealCoronagraph< _realT >::setPupil(), and mx::astro::cahoyGrid< _units >::setSpectrum().