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

How mxlib handles errors

Modules

 Error Codes
 
 Old Error Handling
 
 Error Handling Files
 
 Error Report Verbosity
 
 Internal Error Reporting
 

Functions

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.
 

Function Documentation

◆ error_message() [1/2]

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.

What is included depends on the verbosity level set by the template parameter

Template Parameters
verboseTsets the verbosity level based on its level member.
Returns
the formatted message
Parameters
[in]codeis an mx::error_t error code
[in]loc[optional] source location

◆ error_message() [2/2]

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.

What is included depends on the verbosity level set by the template parameter

Template Parameters
verboseTsets the verbosity level based on its level member.
Returns
the formatted message
Parameters
[in]codeis an mx::error_t error code
[in]expl[optional] if more information can be provided, use this to inform the user.
[in]loc[optional] source location

◆ error_message< verbose::o >() [1/2]

template<>
std::string mx::error_message< verbose::o > ( const error_t code,
const std::source_location &  loc 
)

Specialization of error_message for verbose::o.

Definition at line 642 of file mxError.cpp.

◆ error_message< verbose::o >() [2/2]

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.

Definition at line 605 of file mxError.cpp.

◆ error_message< verbose::v >() [1/2]

template<>
std::string mx::error_message< verbose::v > ( const error_t code,
const std::source_location &  loc 
)

Specialization of error_message for verbose::v.

Definition at line 649 of file mxError.cpp.

References mx::internal::mxlib_error_message< verbose::v >().

◆ error_message< verbose::v >() [2/2]

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.

Definition at line 613 of file mxError.cpp.

References mx::internal::mxlib_error_message< verbose::v >().

◆ error_message< verbose::vv >() [1/2]

template<>
std::string mx::error_message< verbose::vv > ( const error_t code,
const std::source_location &  loc 
)

Specialization of error_message for verbose::vv.

Definition at line 655 of file mxError.cpp.

References mx::internal::mxlib_error_message< verbose::vv >().

◆ error_message< verbose::vv >() [2/2]

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.

Definition at line 619 of file mxError.cpp.

References mx::internal::mxlib_error_message< verbose::vv >().

◆ error_message< verbose::vvv >() [1/2]

template<>
std::string mx::error_message< verbose::vvv > ( const error_t code,
const std::source_location &  loc 
)

Specialization of error_message for verbose::vvv.

Definition at line 661 of file mxError.cpp.

References mx::errorMessage(), and mx::errorName().

◆ error_message< verbose::vvv >() [2/2]

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.

Definition at line 625 of file mxError.cpp.

References mx::errorMessage(), and mx::errorName().

◆ error_report() [1/2]

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.

What is printed depends on the verbosity level set by the template parameter

Template Parameters
verboseTsets the verbosity level based on its level member.
Returns
the provided error_t code
Parameters
[in]codeis an mx::error_t error code
[in]loc[optional] source location

Definition at line 425 of file mxError.hpp.

◆ error_report() [2/2]

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.

What is printed depends on the verbosity level set by the template parameter

Template Parameters
verboseTsets the verbosity level based on its level member.
Returns
the provided error_t code
Parameters
[in]codeis an mx::error_t error code
[in]expl[optional] if more information can be provided, use this to inform the user.
[in]loc[optional] source location

Definition at line 394 of file mxError.hpp.

◆ error_report< verbose::o >() [1/2]

template<>
error_t mx::error_report< verbose::o > ( const error_t code,
const std::source_location &  loc 
)

Specialization of error_report for verbose::o.

Definition at line 684 of file mxError.cpp.

◆ error_report< verbose::o >() [2/2]

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.

Definition at line 676 of file mxError.cpp.