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

102{
103 std::stringstream s;
104 s << exception;
105 return s.str();
106}
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 108 of file config_api.cpp.

109{
110 return unwind ( exception );
111}
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 73 of file config_api.cpp.

74{
75 return exception.what();
76}

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

85{
86 if ( ers::Issue const * cause = exception.cause() )
87 {
88 return cause->what();
89 }
90 else
91 {
92 return exception.what();
93 }
94}
Base class for any user define issue.
Definition Issue.hpp:69
const Issue * cause() const
return the cause Issue of this Issue
Definition Issue.hpp:97

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

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