53#ifdef MX_NO_ERROR_REPORTS
58 #define mxError( esrc, ecode, expl )
59 #define mxPError( esrc, ecode, expl )
78 #define mxError( esrc, ecode, expl ) \
79 std::cerr << "\n" << mx::error_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
98 #define mxPError( esrc, ecode, expl ) \
99 std::cerr << "\n" << mx::errno_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
118#define MXE_INVALIDARG 25
119#define MXE_INVALIDARG_NAME "MXE_INVALIDARG"
120#define MXE_INVALIDARG_MSG "An argument was invalid."
126#define MXE_INVALIDCONFIG 27
127#define MXE_INVALIDCONFIG_NAME "MXE_INVALIDCONFIG"
128#define MXE_INVALIDCONFIG_MSG "A config setting was invalid."
134#define MXE_NOTIMPL 30
135#define MXE_NOTIMPL_NAME "MXE_NOTIMPL"
136#define MXE_NOTIMPL_MSG "A component or technique is not implemented."
142#define MXE_PARAMNOTSET 35
143#define MXE_PARAMNOTSET_NAME "MXE_PARAMNOTSET"
144#define MXE_PARAMNOTSET_MSG "A parameter was not set."
150#define MXE_ENVNOTSET 36
151#define MXE_ENVNOTSET_NAME "MXE_ENVNOTSET"
152#define MXE_ENVNOTSET_MSG "An environment variable is not set."
158#define MXE_NOTFOUND 40
159#define MXE_NOTFOUND_NAME "MXE_NOTFOUND"
160#define MXE_NOTFOUND_MSG "An item was not found."
166#define MXE_SIZEERR 55
167#define MXE_SIZEERR_NAME "MXE_SIZEERR"
168#define MXE_SIZEERR_MSG "A size was invalid or calculated incorrectly."
174#define MXE_ALLOCERR 60
175#define MXE_ALLOCERR_NAME "MXE_ALLOCERR"
176#define MXE_ALLOCERR_MSG "An error occurred during memory allocation."
182#define MXE_FREEERR 65
183#define MXE_FREEERR_NAME "MXE_FREEERR"
184#define MXE_FREEERR_MSG "An error occurred during memory de-allocation."
190#define MXE_PARSEERR 75
191#define MXE_PARSEERR_NAME "MXE_PARSEERR"
192#define MXE_PARSEERR_MSG "A parsing error occurred."
198#define MXE_FILEOERR 1034
199#define MXE_FILEOERR_NAME "MXE_FILEOERR"
200#define MXE_FILEOERR_MSG "An error occurred while opening a file."
206#define MXE_FILEWERR 1044
207#define MXE_FILEWERR_NAME "MXE_FILEWERR"
208#define MXE_FILEWERR_MSG "An error occurred while writing to a file."
214#define MXE_FILERERR 1049
215#define MXE_FILERERR_NAME "MXE_FILERERR"
216#define MXE_FILERERR_MSG "An error occurred while reading from a file."
222#define MXE_FILECERR 1054
223#define MXE_FILECERR_NAME "MXE_FILECERR"
224#define MXE_FILECERR_MSG "An error occurred while closing a file."
230#define MXE_FILENOTFOUND 1059
231#define MXE_FILENOTFOUND_NAME "MXE_FILENOTFOUND"
232#define MXE_FILENOTFOUND_MSG "The file was not found."
238#define MXE_PROCERR 2001
239#define MXE_PROCERR_NAME "MXE_PROCERR"
240#define MXE_PROCERR_MSG "An error occured while starting a process."
246#define MXE_TIMEOUT 2322
247#define MXE_TIMEOUT_NAME "MXE_TIMEOUT"
248#define MXE_TIMEOUT_MSG "A timeout occurred."
254#define MXE_LIBERR 4000
255#define MXE_LIBERR_NAME "MXE_LIBERR"
256#define MXE_LIBERR_MSG "An error was returned by a library."
265#define MXE_EXCEPTTHROWN 4010
266#define MXE_EXCEPTTHROWN_NAME "MXE_EXCEPTTHROWN"
267#define MXE_EXCEPTTHROWN_MSG "An exception was thrown."
273#define MXE_GNUPLOTERR 4567
274#define MXE_GNUPLOTERR_NAME "MXE_GNUPLOTERR"
275#define MXE_GNUPLOTERR_MSG "An error was returned by gnuplot."
281#define MXE_LAPACKERR 6890
282#define MXE_LAPACKERR_NAME "MXE_LAPACKERR"
283#define MXE_LAPACKERR_MSG "An error was returned by Lapack."
320 const std::string &source,
322 const std::string &file,
324 const std::string &expl =
""
334 const std::string &source,
336 const std::string &file,
338 const std::string &expl =
""
std::string MXE_CodeToName(int ec)
Return the name for an mxlib error code.
std::string errno_CodeToName(int ec)
Return the macro name and a message for a standard errno code.
std::string MXE_CodeToDescription(int ec)
Return the description for an mxlib error code.
std::string errno_report(const std::string &source, int ec, const std::string &file, const int &line, const std::string &expl="")
Construct a rich error report given a standard errno error code.
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.