53 #ifdef MX_NO_ERROR_REPORTS
58 #define mxError(esrc,ecode,expl)
59 #define mxPError(esrc,ecode,expl)
79 #define mxError(esrc,ecode,expl) std::cerr << "\n" << mx::error_report(esrc, ecode, __FILE__, __LINE__, expl) << "\n";
96 #define mxPError(esrc,ecode,expl) std::cerr << "\n" << mx::errno_report(esrc, ecode, __FILE__, __LINE__, expl) << "\n";
116 #define MXE_INVALIDARG 25
117 #define MXE_INVALIDARG_NAME "MXE_INVALIDARG"
118 #define MXE_INVALIDARG_MSG "An argument was invalid."
124 #define MXE_INVALIDCONFIG 27
125 #define MXE_INVALIDCONFIG_NAME "MXE_INVALIDCONFIG"
126 #define MXE_INVALIDCONFIG_MSG "A config setting was invalid."
132 #define MXE_NOTIMPL 30
133 #define MXE_NOTIMPL_NAME "MXE_NOTIMPL"
134 #define MXE_NOTIMPL_MSG "A component or technique is not implemented."
140 #define MXE_PARAMNOTSET 35
141 #define MXE_PARAMNOTSET_NAME "MXE_PARAMNOTSET"
142 #define MXE_PARAMNOTSET_MSG "A parameter was not set."
148 #define MXE_ENVNOTSET 36
149 #define MXE_ENVNOTSET_NAME "MXE_ENVNOTSET"
150 #define MXE_ENVNOTSET_MSG "An environment variable is not set."
156 #define MXE_NOTFOUND 40
157 #define MXE_NOTFOUND_NAME "MXE_NOTFOUND"
158 #define MXE_NOTFOUND_MSG "An item was not found."
164 #define MXE_SIZEERR 55
165 #define MXE_SIZEERR_NAME "MXE_SIZEERR"
166 #define MXE_SIZEERR_MSG "A size was invalid or calculated incorrectly."
172 #define MXE_ALLOCERR 60
173 #define MXE_ALLOCERR_NAME "MXE_ALLOCERR"
174 #define MXE_ALLOCERR_MSG "An error occurred during memory allocation."
180 #define MXE_FREEERR 65
181 #define MXE_FREEERR_NAME "MXE_FREEERR"
182 #define MXE_FREEERR_MSG "An error occurred during memory de-allocation."
189 #define MXE_PARSEERR 75
190 #define MXE_PARSEERR_NAME "MXE_PARSEERR"
191 #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."
263 #define MXE_GNUPLOTERR 4567
264 #define MXE_GNUPLOTERR_NAME "MXE_GNUPLOTERR"
265 #define MXE_GNUPLOTERR_MSG "An error was returned by gnuplot."
271 #define MXE_LAPACKERR 6890
272 #define MXE_LAPACKERR_NAME "MXE_LAPACKERR"
273 #define MXE_LAPACKERR_MSG "An error was returned by Lapack."
312 const std::string & file,
314 const std::string & expl =
""
326 const std::string & file,
328 const std::string & expl =
""
std::string error_report(const std::string &source, const int &code, const std::string &file, const int &line, const std::string &expl="")
Construct a rich error report given an mxlib error code.
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.