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 98 of file config_api.cpp.

99{
100 std::stringstream s;
101 s << exception;
102 return s.str();
103}
caught dunedaq::conffwk::Exception exception

◆ parse()

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

Parses the error in the exception to a string

Definition at line 105 of file config_api.cpp.

106{
107 return unwind ( exception );
108}
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 70 of file config_api.cpp.

71{
72 return exception.what();
73}

◆ 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 81 of file config_api.cpp.

82{
83 if ( ers::Issue const * cause = exception.cause() )
84 {
85 return cause->what();
86 }
87 else
88 {
89 return exception.what();
90 }
91}
Base class for any user define issue.
Definition Issue.hpp:80

◆ 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 42 of file config_api.cpp.

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