libzypp  17.11.4
HalException.h
Go to the documentation of this file.
1 /*---------------------------------------------------------------------\
2 | ____ _ __ __ ___ |
3 | |__ / \ / / . \ . \ |
4 | / / \ V /| _/ _/ |
5 | / /__ | | | | | | |
6 | /_____||_| |_| |_| |
7 | |
8 \---------------------------------------------------------------------*/
13 #ifndef ZYPP_TARGET_HAL_HALEXCEPTION_H
14 #define ZYPP_TARGET_HAL_HALEXCEPTION_H
15 
16 #include "zypp/base/Exception.h"
17 #include "zypp/base/String.h"
18 
20 namespace zypp
21 {
22  namespace target
24  {
25  namespace hal
27  {
28 
29 
31  //
32  // CLASS NAME : HalException
33  //
38  {
39  public:
43  HalException();
44 
50  HalException(const std::string &msg_r);
51 
55  HalException(const std::string &err_name, const std::string &err_msg);
56 
59  virtual ~HalException() throw() {};
60 
64  const std::string & errorName() const
65  {
66  return e_name;
67  }
68 
72  const std::string & errorMessage() const
73  {
74  return e_msg;
75  }
76 
77  protected:
78  virtual std::ostream & dumpOn( std::ostream & str ) const;
79 
80  private:
81  std::string e_name;
82  std::string e_msg;
83  };
84 
87  struct NoHalException: public Exception
88  { NoHalException(); };
89 
91  } // namespace hal
94  } // namespace target
97 } // namespace zypp
99 
100 #endif // ZYPP_TARGET_HAL_HALEXCEPTION_H
101 
102 /*
103 ** vim: set ts=2 sts=2 sw=2 ai et:
104 */
Exception thrown if we were built without hal support (-DNO_HAL).
Definition: HalException.h:87
const std::string & errorName() const
Definition: HalException.h:64
String related utilities and Regular expression matching.
Hardware abstaction layer exception.
Definition: HalException.h:37
virtual ~HalException()
Destructor.
Definition: HalException.h:59
HalException()
Default constructor.
Definition: HalContext.cc:24
virtual std::ostream & dumpOn(std::ostream &str) const
Overload this to print a proper error message.
Definition: HalContext.cc:161
Base class for Exception.
Definition: Exception.h:145
const std::string & errorMessage() const
Definition: HalException.h:72
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1