libzypp 17.31.23
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
19#include <zypp/base/Exception.h>
20#include <zypp/Pathname.h>
21#include <zypp/Url.h>
22
24namespace zypp
25{
26namespace target
27{
29namespace rpm
30{
32//
33// CLASS NAME : RpmException
37class RpmException : public Exception
38{
39public:
44 : Exception( "Rpm Exception" )
45 {}
49 RpmException( const std::string & msg_r )
50 : Exception( msg_r )
51 {}
53 virtual ~RpmException() throw()
54 {};
55};
56
58{
59public:
64 : RpmException("Global RPM initialization failed")
65 {}
67 virtual ~GlobalRpmInitException() throw()
68 {};
69private:
70};
71
73{
74public:
79 const Pathname & dbpath_r )
80 : RpmException()
81 , _root(root_r.asString())
82 , _dbpath(dbpath_r.asString())
83 {}
85 virtual ~RpmInvalidRootException() throw()
86 {};
87 std::string root() const
88 {
89 return _root;
90 }
91 std::string dbpath() const
92 {
93 return _dbpath;
94 }
95protected:
96 virtual std::ostream & dumpOn( std::ostream & str ) const;
97private:
98 std::string _root;
99 std::string _dbpath;
100};
101
103{
104public:
106 const Pathname & dbpath_r )
107 : RpmException()
108 , _root(root_r.asString())
109 , _dbpath(dbpath_r.asString())
110 {}
112 {};
113 std::string root() const
114 {
115 return _root;
116 }
117 std::string dbpath() const
118 {
119 return _dbpath;
120 }
121protected:
122 virtual std::ostream & dumpOn( std::ostream & str ) const;
123private:
124 std::string _root;
125 std::string _dbpath;
126};
127
129{
130public:
131 RpmSubprocessException(const std::string & errmsg_r)
132 : RpmException()
133 , _errmsg(errmsg_r)
134 {}
135 virtual ~RpmSubprocessException() throw()
136 {};
137protected:
138 virtual std::ostream & dumpOn( std::ostream & str ) const;
139private:
140 std::string _errmsg;
141};
142
144{
145public:
147 const Pathname & dbpath_r)
148 : RpmException()
149 , _root(root_r.asString())
150 , _dbpath(dbpath_r.asString())
151 {}
152 virtual ~RpmInitException() throw()
153 {};
154protected:
155 virtual std::ostream & dumpOn( std::ostream & str ) const;
156private:
157 std::string _root;
158 std::string _dbpath;
159};
160
162{
163public:
165 const Pathname & dbpath_r)
166 : RpmException()
167 , _root(root_r.asString())
168 , _dbpath(dbpath_r.asString())
169 {}
170 virtual ~RpmDbOpenException() throw()
171 {};
172protected:
173 virtual std::ostream & dumpOn( std::ostream & str ) const;
174private:
175 std::string _root;
176 std::string _dbpath;
177};
178
180{
181public:
183 const Pathname & old_dbpath_r,
184 const Pathname & new_root_r,
185 const Pathname & new_dbpath_r)
186 : RpmException()
187 , _old_root(old_root_r.asString())
188 , _old_dbpath(old_dbpath_r.asString())
189 , _new_root(new_root_r.asString())
190 , _new_dbpath(new_dbpath_r.asString())
191 {}
193 {};
194protected:
195 virtual std::ostream & dumpOn( std::ostream & str ) const;
196private:
197 std::string _old_root;
198 std::string _old_dbpath;
199 std::string _new_root;
200 std::string _new_dbpath;
201};
202
204{
205public:
207 : RpmException()
208 {}
209 virtual ~RpmDbNotOpenException() throw()
210 {};
211protected:
212 virtual std::ostream & dumpOn( std::ostream & str ) const;
213private:
214};
215
217{
218public:
220 : RpmException()
221 {}
222 virtual ~RpmDbConvertException() throw()
223 {};
224protected:
225 virtual std::ostream & dumpOn( std::ostream & str ) const;
226private:
227};
228
230{
231public:
233 : RpmException()
234 {}
236 {};
237protected:
238 virtual std::ostream & dumpOn( std::ostream & str ) const;
239private:
240};
241
243{
244public:
245 RpmTransactionFailedException(const std::string & errmsg_r)
246 : RpmException()
247 , _errmsg(errmsg_r)
248 {}
250 {};
251protected:
252 virtual std::ostream & dumpOn( std::ostream & str ) const;
253private:
254 std::string _errmsg;
255};
256
257
258
260} // namespace rpm
261} // namespace target
262} // namespace zypp
264#endif // ZYPP_TARGET_RPM_RPMEXCEPTION_H
Base class for Exception.
Definition: Exception.h:146
std::string asString() const
Error message provided by dumpOn as string.
Definition: Exception.cc:75
GlobalRpmInitException()
Ctor taking message.
Definition: RpmException.h:63
RpmAccessBlockedException(const Pathname &root_r, const Pathname &dbpath_r)
Definition: RpmException.h:105
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:34
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:57
RpmDbAlreadyOpenException(const Pathname &old_root_r, const Pathname &old_dbpath_r, const Pathname &new_root_r, const Pathname &new_dbpath_r)
Definition: RpmException.h:182
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:68
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:63
RpmDbOpenException(const Pathname &root_r, const Pathname &dbpath_r)
Definition: RpmException.h:164
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:51
Just inherits Exception to separate media exceptions.
Definition: RpmException.h:38
RpmException()
Ctor taking message.
Definition: RpmException.h:43
RpmException(const std::string &msg_r)
Ctor taking message.
Definition: RpmException.h:49
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:45
RpmInitException(const Pathname &root_r, const Pathname &dbpath_r)
Definition: RpmException.h:146
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:28
RpmInvalidRootException(const Pathname &root_r, const Pathname &dbpath_r)
Ctor taking message.
Definition: RpmException.h:78
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:73
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:40
RpmSubprocessException(const std::string &errmsg_r)
Definition: RpmException.h:131
RpmTransactionFailedException(const std::string &errmsg_r)
Definition: RpmException.h:245
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: RpmException.cc:78
String related utilities and Regular expression matching.
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:2