libzypp 17.37.10

RpmException.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_TARGET_RPM_RPMEXCEPTION_H
13#define ZYPP_TARGET_RPM_RPMEXCEPTION_H
14
15#include <iosfwd>
16
17#include <string>
18#include <utility>
19
20#include <zypp/base/Exception.h>
21#include <zypp/Pathname.h>
22#include <zypp/Url.h>
23
25 namespace zypp
26{
27 namespace target
28{
30 namespace rpm
31{
33//
34// CLASS NAME : RpmException
38 class ZYPP_API RpmException : public Exception
39{
40 public:
44 RpmException()
45 : Exception( "Rpm Exception" )
46 {}
47
50 RpmException( const std::string & msg_r )
51 : Exception( msg_r )
52 {}
53
54 ~RpmException() throw() override
55 {};
56};
57
58 class ZYPP_API GlobalRpmInitException : public RpmException
59{
60 public:
64 GlobalRpmInitException()
65 : RpmException("Global RPM initialization failed")
66 {}
67
68 ~GlobalRpmInitException() throw() override
69 {};
70 private:
71};
72
73 class ZYPP_API RpmInvalidRootException : public RpmException
74{
75 public:
79 RpmInvalidRootException( const Pathname & root_r,
80 const Pathname & dbpath_r )
81 : RpmException()
82 , _root(root_r.asString())
83 , _dbpath(dbpath_r.asString())
84 {}
85
86 ~RpmInvalidRootException() throw() override
87 {};
88 std::string root() const
89 {
90 return _root;
91 }
92 std::string dbpath() const
93 {
94 return _dbpath;
95 }
96 protected:
97 std::ostream & dumpOn( std::ostream & str ) const override;
98 private:
99 std::string _root;
100 std::string _dbpath;
101};
102
103 class ZYPP_API RpmAccessBlockedException : public RpmException
104{
105 public:
106 RpmAccessBlockedException( const Pathname & root_r,
107 const Pathname & dbpath_r )
108 : RpmException()
109 , _root(root_r.asString())
110 , _dbpath(dbpath_r.asString())
111 {}
112 ~RpmAccessBlockedException() throw() override
113 {};
114 std::string root() const
115 {
116 return _root;
117 }
118 std::string dbpath() const
119 {
120 return _dbpath;
121 }
122 protected:
123 std::ostream & dumpOn( std::ostream & str ) const override;
124 private:
125 std::string _root;
126 std::string _dbpath;
127};
128
129 class ZYPP_API RpmSubprocessException : public RpmException
130{
131 public:
132 RpmSubprocessException(std::string errmsg_r)
133 : RpmException()
134 , _errmsg(std::move(errmsg_r))
135 {}
136 ~RpmSubprocessException() throw() override
137 {};
138 protected:
139 std::ostream & dumpOn( std::ostream & str ) const override;
140 private:
141 std::string _errmsg;
142};
143
144 class ZYPP_API RpmInitException : public RpmException
145{
146 public:
147 RpmInitException(const Pathname & root_r,
148 const Pathname & dbpath_r)
149 : RpmException()
150 , _root(root_r.asString())
151 , _dbpath(dbpath_r.asString())
152 {}
153 ~RpmInitException() throw() override
154 {};
155 protected:
156 std::ostream & dumpOn( std::ostream & str ) const override;
157 private:
158 std::string _root;
159 std::string _dbpath;
160};
161
162 class ZYPP_API RpmDbOpenException : public RpmException
163{
164 public:
165 RpmDbOpenException(const Pathname & root_r,
166 const Pathname & dbpath_r)
167 : RpmException()
168 , _root(root_r.asString())
169 , _dbpath(dbpath_r.asString())
170 {}
171 ~RpmDbOpenException() throw() override
172 {};
173 protected:
174 std::ostream & dumpOn( std::ostream & str ) const override;
175 private:
176 std::string _root;
177 std::string _dbpath;
178};
179
180 class ZYPP_API RpmDbAlreadyOpenException : public RpmException
181{
182 public:
183 RpmDbAlreadyOpenException(const Pathname & old_root_r,
184 const Pathname & old_dbpath_r,
185 const Pathname & new_root_r,
186 const Pathname & new_dbpath_r)
187 : RpmException()
188 , _old_root(old_root_r.asString())
189 , _old_dbpath(old_dbpath_r.asString())
190 , _new_root(new_root_r.asString())
191 , _new_dbpath(new_dbpath_r.asString())
192 {}
193 ~RpmDbAlreadyOpenException() throw() override
194 {};
195 protected:
196 std::ostream & dumpOn( std::ostream & str ) const override;
197 private:
198 std::string _old_root;
199 std::string _old_dbpath;
200 std::string _new_root;
201 std::string _new_dbpath;
202};
203
204 class ZYPP_API RpmDbNotOpenException : public RpmException
205{
206 public:
207 RpmDbNotOpenException()
208 : RpmException()
209 {}
210 ~RpmDbNotOpenException() throw() override
211 {};
212 protected:
213 std::ostream & dumpOn( std::ostream & str ) const override;
214 private:
215};
216
217 class ZYPP_API RpmDbConvertException : public RpmException
218{
219 public:
220 RpmDbConvertException()
221 : RpmException()
222 {}
223 ~RpmDbConvertException() throw() override
224 {};
225 protected:
226 std::ostream & dumpOn( std::ostream & str ) const override;
227 private:
228};
229
230 class ZYPP_API RpmNullDatabaseException : public RpmException
231{
232 public:
233 RpmNullDatabaseException()
234 : RpmException()
235 {}
236 ~RpmNullDatabaseException() throw() override
237 {};
238 protected:
239 std::ostream & dumpOn( std::ostream & str ) const override;
240 private:
241};
242
243 class ZYPP_API RpmTransactionFailedException : public RpmException
244{
245 public:
246 RpmTransactionFailedException(std::string errmsg_r)
247 : RpmException()
248 , _errmsg(std::move(errmsg_r))
249 {}
250 ~RpmTransactionFailedException() throw() override
251 {};
252 protected:
253 std::ostream & dumpOn( std::ostream & str ) const override;
254 private:
255 std::string _errmsg;
256};
257
258
259
261} // namespace rpm
262} // namespace target
263} // namespace zypp
265#endif // ZYPP_TARGET_RPM_RPMEXCEPTION_H
zypp::Exception::asString
std::string asString() const
Error message provided by dumpOn as string.
Definition Exception.cc:124
zypp::Exception::Exception
Exception()
Default ctor.
Definition Exception.cc:94
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:47
zypp::target::rpm::GlobalRpmInitException::~GlobalRpmInitException
~GlobalRpmInitException() override
Dtor.
Definition RpmException.h:68
zypp::target::rpm::GlobalRpmInitException::GlobalRpmInitException
GlobalRpmInitException()
Ctor taking message.
Definition RpmException.h:64
zypp::target::rpm::RpmAccessBlockedException::RpmAccessBlockedException
RpmAccessBlockedException(const Pathname &root_r, const Pathname &dbpath_r)
Definition RpmException.h:106
zypp::target::rpm::RpmAccessBlockedException::dbpath
std::string dbpath() const
Definition RpmException.h:118
zypp::target::rpm::RpmAccessBlockedException::_root
std::string _root
Definition RpmException.h:125
zypp::target::rpm::RpmAccessBlockedException::~RpmAccessBlockedException
~RpmAccessBlockedException() override
Definition RpmException.h:112
zypp::target::rpm::RpmAccessBlockedException::_dbpath
std::string _dbpath
Definition RpmException.h:126
zypp::target::rpm::RpmAccessBlockedException::root
std::string root() const
Definition RpmException.h:114
zypp::target::rpm::RpmDbAlreadyOpenException::_new_root
std::string _new_root
Definition RpmException.h:200
zypp::target::rpm::RpmDbAlreadyOpenException::_old_dbpath
std::string _old_dbpath
Definition RpmException.h:199
zypp::target::rpm::RpmDbAlreadyOpenException::_new_dbpath
std::string _new_dbpath
Definition RpmException.h:201
zypp::target::rpm::RpmDbAlreadyOpenException::_old_root
std::string _old_root
Definition RpmException.h:198
zypp::target::rpm::RpmDbAlreadyOpenException::~RpmDbAlreadyOpenException
~RpmDbAlreadyOpenException() override
Definition RpmException.h:193
zypp::target::rpm::RpmDbAlreadyOpenException::RpmDbAlreadyOpenException
RpmDbAlreadyOpenException(const Pathname &old_root_r, const Pathname &old_dbpath_r, const Pathname &new_root_r, const Pathname &new_dbpath_r)
Definition RpmException.h:183
zypp::target::rpm::RpmDbConvertException::RpmDbConvertException
RpmDbConvertException()
Definition RpmException.h:220
zypp::target::rpm::RpmDbConvertException::~RpmDbConvertException
~RpmDbConvertException() override
Definition RpmException.h:223
zypp::target::rpm::RpmDbNotOpenException::~RpmDbNotOpenException
~RpmDbNotOpenException() override
Definition RpmException.h:210
zypp::target::rpm::RpmDbNotOpenException::RpmDbNotOpenException
RpmDbNotOpenException()
Definition RpmException.h:207
zypp::target::rpm::RpmDbOpenException::_dbpath
std::string _dbpath
Definition RpmException.h:177
zypp::target::rpm::RpmDbOpenException::_root
std::string _root
Definition RpmException.h:176
zypp::target::rpm::RpmDbOpenException::~RpmDbOpenException
~RpmDbOpenException() override
Definition RpmException.h:171
zypp::target::rpm::RpmDbOpenException::RpmDbOpenException
RpmDbOpenException(const Pathname &root_r, const Pathname &dbpath_r)
Definition RpmException.h:165
zypp::target::rpm::RpmException::RpmException
RpmException()
Ctor taking message.
Definition RpmException.h:44
zypp::target::rpm::RpmException::RpmException
RpmException(const std::string &msg_r)
Ctor taking message.
Definition RpmException.h:50
zypp::target::rpm::RpmException::~RpmException
~RpmException() override
Dtor.
Definition RpmException.h:54
zypp::target::rpm::RpmInitException::_dbpath
std::string _dbpath
Definition RpmException.h:159
zypp::target::rpm::RpmInitException::_root
std::string _root
Definition RpmException.h:158
zypp::target::rpm::RpmInitException::~RpmInitException
~RpmInitException() override
Definition RpmException.h:153
zypp::target::rpm::RpmInitException::RpmInitException
RpmInitException(const Pathname &root_r, const Pathname &dbpath_r)
Definition RpmException.h:147
zypp::target::rpm::RpmInvalidRootException::_dbpath
std::string _dbpath
Definition RpmException.h:100
zypp::target::rpm::RpmInvalidRootException::_root
std::string _root
Definition RpmException.h:99
zypp::target::rpm::RpmInvalidRootException::root
std::string root() const
Definition RpmException.h:88
zypp::target::rpm::RpmInvalidRootException::dbpath
std::string dbpath() const
Definition RpmException.h:92
zypp::target::rpm::RpmInvalidRootException::RpmInvalidRootException
RpmInvalidRootException(const Pathname &root_r, const Pathname &dbpath_r)
Ctor taking message.
Definition RpmException.h:79
zypp::target::rpm::RpmInvalidRootException::~RpmInvalidRootException
~RpmInvalidRootException() override
Dtor.
Definition RpmException.h:86
zypp::target::rpm::RpmNullDatabaseException::RpmNullDatabaseException
RpmNullDatabaseException()
Definition RpmException.h:233
zypp::target::rpm::RpmNullDatabaseException::~RpmNullDatabaseException
~RpmNullDatabaseException() override
Definition RpmException.h:236
zypp::target::rpm::RpmSubprocessException::_errmsg
std::string _errmsg
Definition RpmException.h:141
zypp::target::rpm::RpmSubprocessException::~RpmSubprocessException
~RpmSubprocessException() override
Definition RpmException.h:136
zypp::target::rpm::RpmSubprocessException::RpmSubprocessException
RpmSubprocessException(std::string errmsg_r)
Definition RpmException.h:132
zypp::target::rpm::RpmTransactionFailedException::_errmsg
std::string _errmsg
Definition RpmException.h:255
zypp::target::rpm::RpmTransactionFailedException::~RpmTransactionFailedException
~RpmTransactionFailedException() override
Definition RpmException.h:250
zypp::target::rpm::RpmTransactionFailedException::RpmTransactionFailedException
RpmTransactionFailedException(std::string errmsg_r)
Definition RpmException.h:246
std
Definition Arch.h:364
str
String related utilities and Regular expression matching.
zypp::target::rpm
Definition KeyRing.h:327
zypp::target
Definition KeyRing.h:325
zypp::target::dumpOn
std::ostream & dumpOn(std::ostream &str, const RpmPostTransCollector &obj)
Definition RpmPostTransCollector.cc:435
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition Application.cc:20
zypp::ZYPP_API
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247
Pathname.h
Url.h
Exception.h