mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
Loading...
Searching...
No Matches
mxErrorOld.hpp File Reference

Old version. Deprecated. Declares and defines the mxlib error reporting system. More...

Old version. Deprecated. Declares and defines the mxlib error reporting system.

Author
Jared R. Males (jared.nosp@m.male.nosp@m.s@gma.nosp@m.il.c.nosp@m.om)

Definition in file mxErrorOld.hpp.

#include <iostream>

Go to the source code of this file.

Namespaces

namespace  mx
 The mxlib c++ namespace.
 

Macros

#define mxError(esrc, ecode, expl)    std::cerr << "\n" << mx::error_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
 This reports an mxlib specific error.
 
#define mxPError(esrc, ecode, expl)    std::cerr << "\n" << mx::errno_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";
 This reports a standard library error, taking after perror.
 
#define MXE_INVALIDARG   25
 An argument was invalid.
 
#define MXE_INVALIDCONFIG   27
 A config setting was invalid.
 
#define MXE_NOTIMPL   30
 A component or technique is not implemented.
 
#define MXE_PARAMNOTSET   35
 A parameter was not set.
 
#define MXE_ENVNOTSET   36
 An environment variable is not set.
 
#define MXE_NOTFOUND   40
 An item was not found.
 
#define MXE_SIZEERR   55
 A size was invalid or calculated incorrectly.
 
#define MXE_ALLOCERR   60
 An error occurred during memory allocation.
 
#define MXE_FREEERR   65
 An error occurred during memory de-allocation.
 
#define MXE_PARSEERR   75
 A parsing error occurred.
 
#define MXE_FILEOERR   1034
 An error occurred while opening a file.
 
#define MXE_FILEWERR   1044
 An error occurred while writing to a file.
 
#define MXE_FILERERR   1049
 An error occurred while reading from a file.
 
#define MXE_FILECERR   1054
 An error occurred while closing a file.
 
#define MXE_FILENOTFOUND   1059
 The file was not found.
 
#define MXE_PROCERR   2001
 An error occrred while starting a process.
 
#define MXE_TIMEOUT   2322
 A timeout occurred.
 
#define MXE_LIBERR   4000
 An error was returned by a library.
 
#define MXE_EXCEPTTHROWN   4010
 An exception was thrown.
 
#define MXE_GNUPLOTERR   4567
 An error was returned by gnuplot.
 
#define MXE_LAPACKERR   6890
 An error was returned by Lapack.
 

Functions

std::string mx::MXE_CodeToName (int ec)
 Return the name for an mxlib error code.
 
std::string mx::MXE_CodeToDescription (int ec)
 Return the description for an mxlib error code.
 
std::string mx::errno_CodeToName (int ec)
 Return the macro name and a message for a standard errno code.
 
std::string mx::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 mx::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.
 

Macro Definition Documentation

◆ mxPError

#define mxPError (   esrc,
  ecode,
  expl 
)     std::cerr << "\n" << mx::errno_report( esrc, ecode, __FILE__, __LINE__, expl ) << "\n";

This reports a standard library error, taking after perror.

Can be pre-defined 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 92 of file mxErrorOld.hpp.