38 return MXE_INVALIDARG_NAME;
39 case MXE_INVALIDCONFIG:
40 return MXE_INVALIDCONFIG_NAME;
42 return MXE_NOTIMPL_NAME;
44 return MXE_PARAMNOTSET_NAME;
46 return MXE_ENVNOTSET_NAME;
48 return MXE_NOTFOUND_NAME;
50 return MXE_SIZEERR_NAME;
52 return MXE_ALLOCERR_NAME;
54 return MXE_FREEERR_NAME;
56 return MXE_PARSEERR_NAME;
58 return MXE_FILEOERR_NAME;
60 return MXE_FILEWERR_NAME;
62 return MXE_FILERERR_NAME;
64 return MXE_FILECERR_NAME;
65 case MXE_FILENOTFOUND:
66 return MXE_FILENOTFOUND_NAME;
68 return MXE_PROCERR_NAME;
70 return MXE_TIMEOUT_NAME;
72 return MXE_LIBERR_NAME;
74 return MXE_GNUPLOTERR_NAME;
76 return MXE_LAPACKERR_NAME;
88 return MXE_INVALIDARG_MSG;
89 case MXE_INVALIDCONFIG:
90 return MXE_INVALIDCONFIG_MSG;
92 return MXE_NOTIMPL_MSG;
94 return MXE_PARAMNOTSET_MSG;
96 return MXE_ENVNOTSET_MSG;
98 return MXE_NOTFOUND_MSG;
100 return MXE_SIZEERR_MSG;
102 return MXE_ALLOCERR_MSG;
104 return MXE_FREEERR_MSG;
106 return MXE_PARSEERR_MSG;
108 return MXE_FILEOERR_MSG;
110 return MXE_FILEWERR_MSG;
112 return MXE_FILERERR_MSG;
114 return MXE_FILECERR_MSG;
115 case MXE_FILENOTFOUND:
116 return MXE_FILENOTFOUND_MSG;
118 return MXE_PROCERR_MSG;
120 return MXE_TIMEOUT_MSG;
122 return MXE_LIBERR_MSG;
124 return MXE_GNUPLOTERR_MSG;
126 return MXE_LAPACKERR_MSG;
128 return "Unknown mxlib error code.";
150 return "EADDRNOTAVAIL";
154 return "EAFNOSUPPORT";
158 #if (EWOULDBLOCK == EAGAIN)
159 return "EAGIAN / EWOULDBLOCK";
190 return "ECONNABORTED";
194 return "ECONNREFUSED";
202 return "EDESTADDRREQ";
222 return "EHOSTUNREACH";
234 return "EINPROGRESS";
274 return "ENAMETOOLONG";
286 return "ENETUNREACH";
330 return "ENOPROTOOPT";
360 #ifdef ENOTRECOVERABLE
361 case ENOTRECOVERABLE:
362 return "ENOTRECOVERABLE";
369 #if (ENOTSUP != EOPNOTSUPP)
406 #ifdef EPROTONOSUPPORT
407 case EPROTONOSUPPORT:
408 return "EPROTONOSUPPORT";
443 #if (EWOULDBLOCK != EAGAIN)
445 return "EWOULDBLOCK";
460 const std::string & file,
462 const std::string & expl
466 std::string codeName, codeMessage;
471 std::ostringstream s;
474 s <<
"An error has occured in an mxlib component.\n";
475 s <<
" source: " << source <<
"\n";
476 s <<
" code: " << codeName <<
"(" << code <<
")\n";
477 s <<
" code msg: " << codeMessage <<
"\n";
478 s <<
" in file: " << file <<
"\n";
479 s <<
" at line: " << line <<
"\n";
481 s <<
" explanation: " << expl <<
"\n";
488 const std::string & file,
490 const std::string & expl
493 std::string codeName, codeMessage;
496 codeMessage = strerror(ec);
498 std::ostringstream s;
501 s <<
"An error has occured in an mxlib component.\n";
502 s <<
" source: " << source <<
"\n";
503 s <<
" errno code: " << codeName <<
"(" << ec <<
")\n";
504 s <<
" code msg: " << codeMessage <<
"\n";
505 s <<
" in file: " << file <<
"\n";
506 s <<
" at line: " << line <<
"\n";
508 s <<
" explanation: " << expl <<
"\n";
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.
Declares and defines the mxlib error reporting system.