ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Database
AthenaPOOL
AthenaPoolCnvSvc
src
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
11
12
13
#include "
AthenaPoolCnvSvc/exceptions.h
"
14
#include "
CxxUtils/exctrace.h
"
15
#include "GaudiKernel/System.h"
16
#include <format>
17
#include <sstream>
18
#include <iostream>
19
20
namespace
AthenaPoolCnvSvc
{
21
22
24
std::string
excNoDictForClass_format
(
const
std::type_info& ti)
25
{
26
return
std::string(
"AthenaPoolCnvSvc::::ExcNoDictForClass: "
27
"Can't find dictionary information for class: "
) +
28
System::typeinfoName(ti);
29
}
30
31
36
ExcNoDictForClass::ExcNoDictForClass
(
const
std::type_info& ti)
37
:
std
::
runtime_error
(
excNoDictForClass_format
(ti))
38
{
39
}
40
41
46
void
throwExcNoDictForClass
(
const
std::type_info& ti)
47
{
48
throw
ExcNoDictForClass
(ti);
49
}
50
51
52
//*************************************************************************
53
54
56
std::string
excUnsupportedVersion_format
(
const
std::type_info& ti,
57
const
Guid
& guid)
58
{
59
return
std::string(
"AthenaPoolCnvSvc::::ExcUnsupportedVersion: "
60
"Unsupported persistent version of "
) +
61
System::typeinfoName(ti) +
" found; guid: "
+ guid.toString();
62
}
63
64
70
ExcUnsupportedVersion::ExcUnsupportedVersion
(
const
std::type_info& ti,
71
const
Guid
& guid)
72
:
std
::
runtime_error
(
excUnsupportedVersion_format
(ti, guid))
73
{
74
}
75
76
82
void
throwExcUnsupportedVersion
(
const
std::type_info& ti,
const
Guid
& guid)
83
{
84
throw
ExcUnsupportedVersion
(ti, guid);
85
}
86
87
88
//*************************************************************************
89
90
92
std::string
excCaughtException_format
(
const
char
* fnname,
93
const
char
* action,
94
const
std::exception& ex,
95
const
std::type_info& ti,
96
const
std::string& key)
97
{
98
return
std::format(
"AthenaPoolCnvSvc::::ExcCaughtException: Caught exception in {} while {}{}/{}: {}: {}"
,
99
fnname, action, System::typeinfoName(ti), key,
100
System::typeinfoName(
typeid
(ex)), ex.what());
101
}
102
103
112
ExcCaughtException::ExcCaughtException
(
const
char
* fnname,
113
const
char
* action,
114
const
std::exception& ex,
115
const
std::type_info& ti,
116
const
std::string& key)
117
:
std
::
runtime_error
(
excCaughtException_format
(fnname, action, ex, ti, key))
118
{
119
}
120
121
132
void
throwExcCaughtException
(
const
char
* fnname,
133
const
char
* action,
134
const
std::exception& ex,
135
const
std::type_info& ti,
136
const
std::string& key)
137
{
138
std::cout.flush();
139
std::cerr.flush();
140
CxxUtils::exctrace
(ex);
141
throw
ExcCaughtException
(fnname, action, ex, ti, key);
142
}
143
144
145
}
// namespace AthenaPoolCnvSvc
exceptions.h
Exceptions that can be thrown from AthenaPoolCnvSvc.
AthenaPoolCnvSvc::ExcCaughtException
Exception — Caught an exception during conversion.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h:87
AthenaPoolCnvSvc::ExcCaughtException::ExcCaughtException
ExcCaughtException(const char *fnname, const char *action, const std::exception &ex, const std::type_info &ti, const std::string &key)
Constructor.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:112
AthenaPoolCnvSvc::ExcNoDictForClass
Exception — Can't find dictionary information for class.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h:35
AthenaPoolCnvSvc::ExcNoDictForClass::ExcNoDictForClass
ExcNoDictForClass(const std::type_info &ti)
Constructor.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:36
AthenaPoolCnvSvc::ExcUnsupportedVersion
Exception — Unsupported persistent version of CLASS found.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/exceptions.h:60
AthenaPoolCnvSvc::ExcUnsupportedVersion::ExcUnsupportedVersion
ExcUnsupportedVersion(const std::type_info &ti, const Guid &guid)
Constructor.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:70
Guid
This class provides a encapsulation of a GUID/UUID/CLSID/IID data structure (128 bit number).
Definition
Guid.h:25
runtime_error
STL class.
exctrace.h
Generate stack trace backs from a caught exception.
AthenaPoolCnvSvc
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/AthenaPoolCnvSvc/debug.h:26
AthenaPoolCnvSvc::throwExcUnsupportedVersion
void throwExcUnsupportedVersion(const std::type_info &ti, const Guid &guid)
Throw a AthenaPoolCnvSvc::ExcUnsupportedVersion exception.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:82
AthenaPoolCnvSvc::throwExcNoDictForClass
void throwExcNoDictForClass(const std::type_info &ti)
Throw a AthenaPoolCnvSvc::ExcNoDictForClass exception.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:46
AthenaPoolCnvSvc::excCaughtException_format
std::string excCaughtException_format(const char *fnname, const char *action, const std::exception &ex, const std::type_info &ti, const std::string &key)
Helper: format exception error string.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:92
AthenaPoolCnvSvc::excUnsupportedVersion_format
std::string excUnsupportedVersion_format(const std::type_info &ti, const Guid &guid)
Helper: format exception error string.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:56
AthenaPoolCnvSvc::excNoDictForClass_format
std::string excNoDictForClass_format(const std::type_info &ti)
Helper: format exception error string.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:24
AthenaPoolCnvSvc::throwExcCaughtException
void throwExcCaughtException(const char *fnname, const char *action, const std::exception &ex, const std::type_info &ti, const std::string &key)
Throw a AthenaPoolCnvSvc::ExcCaughtException exception.
Definition
Database/AthenaPOOL/AthenaPoolCnvSvc/src/exceptions.cxx:132
CxxUtils::exctrace
void exctrace(const std::exception &e, IOFD fd=IOFD_INVALID)
Print out information for the last exception.
Definition
exctrace.cxx:59
std
STL namespace.
Generated on
for ATLAS Offline Software by
1.17.0