libzypp 17.37.17
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
25namespace zypp
26{
27namespace target
28{
30namespace rpm
31{
33//
34// CLASS NAME : RpmException
39{
40public:
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
59{
60public:
65 : RpmException("Global RPM initialization failed")
66 {}
67
68 ~GlobalRpmInitException() throw() override
69 {};
70private:
71};
72
74{
75public:
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 }
96protected:
97 std::ostream & dumpOn( std::ostream & str ) const override;
98private:
99 std::string _root;
100 std::string _dbpath;
101};
102
104{
105public:
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 }
122protected:
123 std::ostream & dumpOn( std::ostream & str ) const override;
124private:
125 std::string _root;
126 std::string _dbpath;
127};
128
130{
131public:
132 RpmSubprocessException(std::string errmsg_r)
133 : RpmException()
134 , _errmsg(std::move(errmsg_r))
135 {}
136 ~RpmSubprocessException() throw() override
137 {};
138protected:
139 std::ostream & dumpOn( std::ostream & str ) const override;
140private:
141 std::string _errmsg;
142};
143
145{
146public:
148 const Pathname & dbpath_r)
149 : RpmException()
150 , _root(root_r.asString())
151 , _dbpath(dbpath_r.asString())
152 {}
153 ~RpmInitException() throw() override
154 {};
155protected:
156 std::ostream & dumpOn( std::ostream & str ) const override;
157private:
158 std::string _root;
159 std::string _dbpath;
160};
161
163{
164public:
166 const Pathname & dbpath_r)
167 : RpmException()
168 , _root(root_r.asString())
169 , _dbpath(dbpath_r.asString())
170 {}
171 ~RpmDbOpenException() throw() override
172 {};
173protected:
174 std::ostream & dumpOn( std::ostream & str ) const override;
175private:
176 std::string _root;
177 std::string _dbpath;
178};
179
181{
182public:
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 {};
195protected:
196 std::ostream & dumpOn( std::ostream & str ) const override;
197private:
198 std::string _old_root;
199 std::string _old_dbpath;
200 std::string _new_root;
201 std::string _new_dbpath;
202};
203
205{
206public:
210 ~RpmDbNotOpenException() throw() override
211 {};
212protected:
213 std::ostream & dumpOn( std::ostream & str ) const override;
214private:
215};
216
218{
219public:
223 ~RpmDbConvertException() throw() override
224 {};
225protected:
226 std::ostream & dumpOn( std::ostream & str ) const override;
227private:
228};
229
231{
232public:
236 ~RpmNullDatabaseException() throw() override
237 {};
238protected:
239 std::ostream & dumpOn( std::ostream & str ) const override;
240private:
241};
242
244{
245public:
246 RpmTransactionFailedException(std::string errmsg_r)
247 : RpmException()
248 , _errmsg(std::move(errmsg_r))
249 {}
251 {};
252protected:
253 std::ostream & dumpOn( std::ostream & str ) const override;
254private:
255 std::string _errmsg;
256};
257
258
259
261} // namespace rpm
262} // namespace target
263} // namespace zypp
265#endif // ZYPP_TARGET_RPM_RPMEXCEPTION_H
std::string asString() const
Error message provided by dumpOn as string.
Definition Exception.cc:124
Exception()
Default ctor.
Definition Exception.cc:94
GlobalRpmInitException()
Ctor taking message.
RpmAccessBlockedException(const Pathname &root_r, const Pathname &dbpath_r)
RpmDbAlreadyOpenException(const Pathname &old_root_r, const Pathname &old_dbpath_r, const Pathname &new_root_r, const Pathname &new_dbpath_r)
RpmDbOpenException(const Pathname &root_r, const Pathname &dbpath_r)
RpmException()
Ctor taking message.
RpmException(const std::string &msg_r)
Ctor taking message.
RpmInitException(const Pathname &root_r, const Pathname &dbpath_r)
RpmInvalidRootException(const Pathname &root_r, const Pathname &dbpath_r)
Ctor taking message.
Definition Arch.h:364
String related utilities and Regular expression matching.
std::ostream & dumpOn(std::ostream &str, const RpmPostTransCollector &obj)
Easy-to use interface to the ZYPP dependency resolver.
const Arch Arch_armv7hnl Arch_armv7nhl ZYPP_API
Definition Arch.h:247