DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dbe::config::errors Namespace Reference

Functions

std::string const parse (ers::Issue const &)
std::string const unwind (ers::Issue const &)
std::string const reason (ers::Issue const &)
std::string const topcause (ers::Issue const &)
std::string const dump (ers::Issue const &)

Function Documentation

◆ dump()

std::string const dbe::config::errors::dump ( ers::Issue const & exception)

Provide all details as specified by TDAQ reporting verbosity

Dump the exception caught at full detail level as specified by the environment

Parameters
exis the exception to process
Returns
a string

Definition at line 90 of file config_api.cpp.

91{
92 std::stringstream s;
93 s << exception;
94 return s.str();
95}

◆ parse()

std::string const dbe::config::errors::parse ( ers::Issue const & exception)

Parses the error in the exception to a string

Definition at line 98 of file config_api.cpp.

99{
100 return unwind(exception);
101}
std::string const unwind(ers::Issue const &)

◆ reason()

std::string const dbe::config::errors::reason ( ers::Issue const & exception)

Retrieve the reason in an exception given

Provide a string with the reason given by the exception

Parameters
exis the exception to process
Returns
a string

Definition at line 63 of file config_api.cpp.

64{
65 return exception.what();
66}

◆ topcause()

std::string const dbe::config::errors::topcause ( ers::Issue const & exception)

Retrieve the originating / top level cause

Provide a string with the top level cause in this exception

Parameters
exis the exception to process
Returns
a string

Definition at line 75 of file config_api.cpp.

76{
77 if (ers::Issue const* cause = exception.cause()) {
78 return cause->what();
79 } else {
80 return exception.what();
81 }
82}
Base class for any user define issue.
Definition Issue.hpp:76
const Issue * cause() const
return the cause Issue of this Issue
Definition Issue.hpp:100

◆ unwind()

std::string const dbe::config::errors::unwind ( ers::Issue const & exception)

Unwind the causes in an exception given

Unwind all causes linked to this exception

Parameters
exthe exception to process
Returns
a string

Definition at line 39 of file config_api.cpp.

40{
41
42 if (ers::Issue const* cause = exception.cause()) {
43 std::stringstream s;
44
45 while (cause != nullptr) {
46 s << cause->what() << "\n";
47 cause = cause->cause();
48 }
49
50 return s.str();
51 } else {
52 return topcause(exception);
53 }
54}
std::string const topcause(ers::Issue const &)