DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
config_api.cpp
Go to the documentation of this file.
1// DUNE DAQ modification notice:
2// This file has been modified from the original ATLAS dbe source for the DUNE DAQ project.
3// Fork baseline commit: dbe-02-12-17 (2022-05-12).
4// Renamed since fork: no.
5
6/*
7 * config_api.cpp
8 *
9 * Created on: Nov 2, 2015
10 * Author: Leonidas Georgopoulos
11 */
12
13#include "dbe/Exceptions.hpp"
14#include "dbe/version.hpp"
16
17#include "conffwk/Errors.hpp"
18#include "ers/Issue.hpp"
19#include <algorithm>
20#include <sstream>
21#include <string>
22
24
25//------------------------------------------------------------------------------------------
26// DBE::CONFIG::ERRORS NAMESPACE
27//------------------------------------------------------------------------------------------
28namespace dbe
29{
30namespace config
31{
32namespace errors
33{
34
35
42std::string const unwind ( ers::Issue const & exception )
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}
63
70std::string const reason ( ers::Issue const & exception )
71{
72 return exception.what();
73}
74
81std::string const topcause ( ers::Issue const & exception )
82{
83 if ( ers::Issue const * cause = exception.cause() )
84 {
85 return cause->what();
86 }
87 else
88 {
89 return exception.what();
90 }
91}
92
98std::string const dump ( ers::Issue const & exception )
99{
100 std::stringstream s;
101 s << exception;
102 return s.str();
103}
104
105std::string const parse ( ers::Issue const & exception )
106{
107 return unwind ( exception );
108}
109
110//------------------------------------------------------------------------------------------
111}
112}
113}
114//------------------------------------------------------------------------------------------
115
Base class for any user define issue.
Definition Issue.hpp:80
char const *const dbe_lib_config_api_version
caught dunedaq::conffwk::Exception exception
std::string const parse(ers::Issue const &)
std::string const topcause(ers::Issue const &)
std::string const dump(ers::Issue const &)
std::string const unwind(ers::Issue const &)
std::string const reason(ers::Issue const &)
Include QT Headers.
#define dbe_compiled_version
Definition version.hpp:22