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

The mxlib error reporting system. More...

The mxlib error reporting system.

Definition in file mxError.hpp.

#include <cerrno>
#include <cstring>
#include <sstream>
#include <source_location>
#include <iostream>
#include <string>
#include "error/mxErrorOld.hpp"
#include "error/error_t.hpp"

Go to the source code of this file.

Classes

struct  mx::verbose::o
 Verbosity level 0, no reports are generated or printed to stderr. More...
 
struct  mx::verbose::v
 Verbosity level 1. Minimal reports with no source location information. More...
 
struct  mx::verbose::vv
 Verbosity level 2. Additional information is provided, including source file and line. More...
 
struct  mx::verbose::vvv
 Verbosity level 3. A full report is provided. More...
 

Namespaces

namespace  mx
 The mxlib c++ namespace.
 
namespace  mx::verbose
 Namespace for the error reporting verbosity levels.
 
namespace  mx::internal
 Namespace for the internal error reporting functions.
 

Functions

template<class verboseT >
std::string mx::internal::mxlib_error_message (const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
 Format a report given an mxlib error_t code and explanation.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::o > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::o.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::v > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::v.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::vv > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::vv.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::vvv > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::vvv.
 
template<class verboseT >
std::string mx::internal::mxlib_error_message (const error_t &code, const std::source_location &loc=std::source_location::current())
 Format a report given an mxlib error_t code.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::o > (const error_t &code, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::o.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::v > (const error_t &code, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::v.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::vv > (const error_t &code, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::vv.
 
template<>
std::string mx::internal::mxlib_error_message< verbose::vvv > (const error_t &code, const std::source_location &loc)
 Specialization of mxlib_error_message for verbose::vvv.
 
template<class verboseT >
error_t mx::internal::mxlib_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.
 
template<>
error_t mx::internal::mxlib_error_report< verbose::o > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of mxlib_error_report for verbose::o.
 
template<class verboseT >
error_t mx::internal::mxlib_error_report (const error_t &code, const std::source_location &loc=std::source_location::current())
 Print a report to stderr given an mxlib error_t code and return the code.
 
template<>
error_t mx::internal::mxlib_error_report< verbose::o > (const error_t &code, const std::source_location &loc)
 Specialization of mxlib_error_report for verbose::o.
 
template<class verboseT >
std::string mx::error_message (const error_t &code, const std::string &expl, const std::source_location &loc=std::source_location::current())
 Format a report given an mxlib error_t code and explanation.
 
template<>
std::string mx::error_message< verbose::o > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of error_message for verbose::o.
 
template<>
std::string mx::error_message< verbose::v > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of error_message for verbose::v.
 
template<>
std::string mx::error_message< verbose::vv > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of error_message for verbose::vv.
 
template<>
std::string mx::error_message< verbose::vvv > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of error_message for verbose::vvv.
 
template<class verboseT >
std::string mx::error_message (const error_t &code, const std::source_location &loc=std::source_location::current())
 Format a report given an mxlib error_t code.
 
template<>
std::string mx::error_message< verbose::o > (const error_t &code, const std::source_location &loc)
 Specialization of error_message for verbose::o.
 
template<>
std::string mx::error_message< verbose::v > (const error_t &code, const std::source_location &loc)
 Specialization of error_message for verbose::v.
 
template<>
std::string mx::error_message< verbose::vv > (const error_t &code, const std::source_location &loc)
 Specialization of error_message for verbose::vv.
 
template<>
std::string mx::error_message< verbose::vvv > (const error_t &code, const std::source_location &loc)
 Specialization of error_message for verbose::vvv.
 
template<class verboseT >
error_t mx::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.
 
template<>
error_t mx::error_report< verbose::o > (const error_t &code, const std::string &expl, const std::source_location &loc)
 Specialization of error_report for verbose::o.
 
template<class verboseT >
error_t mx::error_report (const error_t &code, const std::source_location &loc=std::source_location::current())
 Print a report to stderr given an mxlib error_t code and return the code.
 
template<>
error_t mx::error_report< verbose::o > (const error_t &code, const std::source_location &loc)
 Specialization of error_report for verbose::o.