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

107{
108 std::stringstream s;
109 s << exception;
110 return s.str();
111}
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 113 of file config_api.cpp.

114{
115 return unwind ( exception );
116}
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 78 of file config_api.cpp.

79{
80 return exception.what();
81}

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

90{
91 if ( ers::Issue const * cause = exception.cause() )
92 {
93 return cause->what();
94 }
95 else
96 {
97 return exception.what();
98 }
99}
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 50 of file config_api.cpp.

51{
52
53 if ( ers::Issue const * cause = exception.cause() )
54 {
55 std::stringstream s;
56
57 while ( cause != nullptr )
58 {
59 s << trendl ( cause->what() ) << "\n";
60 cause = cause->cause();
61 }
62
63 return s.str();
64 }
65 else
66 {
67 return topcause ( exception );
68 }
69
70}
std::string const topcause(ers::Issue const &)