47#ifdef MX_NO_ERROR_REPORTS
52 #define mxError( esrc, ecode, expl )
53 #define mxPError( esrc, ecode, expl )
72 #define mxError( esrc, ecode, expl ) \
73 std::cerr << "\n" << mx::error_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
92 #define mxPError( esrc, ecode, expl ) \
93 std::cerr << "\n" << mx::errno_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
112#define MXE_INVALIDARG 25
113#define MXE_INVALIDARG_NAME "MXE_INVALIDARG"
114#define MXE_INVALIDARG_MSG "An argument was invalid."
120#define MXE_INVALIDCONFIG 27
121#define MXE_INVALIDCONFIG_NAME "MXE_INVALIDCONFIG"
122#define MXE_INVALIDCONFIG_MSG "A config setting was invalid."
128#define MXE_NOTIMPL 30
129#define MXE_NOTIMPL_NAME "MXE_NOTIMPL"
130#define MXE_NOTIMPL_MSG "A component or technique is not implemented."
136#define MXE_PARAMNOTSET 35
137#define MXE_PARAMNOTSET_NAME "MXE_PARAMNOTSET"
138#define MXE_PARAMNOTSET_MSG "A parameter was not set."
144#define MXE_ENVNOTSET 36
145#define MXE_ENVNOTSET_NAME "MXE_ENVNOTSET"
146#define MXE_ENVNOTSET_MSG "An environment variable is not set."
152#define MXE_NOTFOUND 40
153#define MXE_NOTFOUND_NAME "MXE_NOTFOUND"
154#define MXE_NOTFOUND_MSG "An item was not found."
160#define MXE_SIZEERR 55
161#define MXE_SIZEERR_NAME "MXE_SIZEERR"
162#define MXE_SIZEERR_MSG "A size was invalid or calculated incorrectly."
168#define MXE_ALLOCERR 60
169#define MXE_ALLOCERR_NAME "MXE_ALLOCERR"
170#define MXE_ALLOCERR_MSG "An error occurred during memory allocation."
176#define MXE_FREEERR 65
177#define MXE_FREEERR_NAME "MXE_FREEERR"
178#define MXE_FREEERR_MSG "An error occurred during memory de-allocation."
184#define MXE_PARSEERR 75
185#define MXE_PARSEERR_NAME "MXE_PARSEERR"
186#define MXE_PARSEERR_MSG "A parsing error occurred."
192#define MXE_FILEOERR 1034
193#define MXE_FILEOERR_NAME "MXE_FILEOERR"
194#define MXE_FILEOERR_MSG "An error occurred while opening a file."
200#define MXE_FILEWERR 1044
201#define MXE_FILEWERR_NAME "MXE_FILEWERR"
202#define MXE_FILEWERR_MSG "An error occurred while writing to a file."
208#define MXE_FILERERR 1049
209#define MXE_FILERERR_NAME "MXE_FILERERR"
210#define MXE_FILERERR_MSG "An error occurred while reading from a file."
216#define MXE_FILECERR 1054
217#define MXE_FILECERR_NAME "MXE_FILECERR"
218#define MXE_FILECERR_MSG "An error occurred while closing a file."
224#define MXE_FILENOTFOUND 1059
225#define MXE_FILENOTFOUND_NAME "MXE_FILENOTFOUND"
226#define MXE_FILENOTFOUND_MSG "The file was not found."
232#define MXE_PROCERR 2001
233#define MXE_PROCERR_NAME "MXE_PROCERR"
234#define MXE_PROCERR_MSG "An error occured while starting a process."
240#define MXE_TIMEOUT 2322
241#define MXE_TIMEOUT_NAME "MXE_TIMEOUT"
242#define MXE_TIMEOUT_MSG "A timeout occurred."
248#define MXE_LIBERR 4000
249#define MXE_LIBERR_NAME "MXE_LIBERR"
250#define MXE_LIBERR_MSG "An error was returned by a library."
259#define MXE_EXCEPTTHROWN 4010
260#define MXE_EXCEPTTHROWN_NAME "MXE_EXCEPTTHROWN"
261#define MXE_EXCEPTTHROWN_MSG "An exception was thrown."
267#define MXE_GNUPLOTERR 4567
268#define MXE_GNUPLOTERR_NAME "MXE_GNUPLOTERR"
269#define MXE_GNUPLOTERR_MSG "An error was returned by gnuplot."
275#define MXE_LAPACKERR 6890
276#define MXE_LAPACKERR_NAME "MXE_LAPACKERR"
277#define MXE_LAPACKERR_MSG "An error was returned by Lapack."
314 const std::string &source,
316 const std::string &file,
318 const std::string &expl =
""
328 const std::string &source,
330 const std::string &file,
332 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.