libzypp  11.13.5
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/Gettext.h"
18 #include "zypp/base/String.h"
19 
20 
22 namespace zypp
23 {
24 
25  namespace target
26  {
27 
28  namespace hal
29  {
30 
31 
33  //
34  // CLASS NAME : HalException
35  //
40  {
41  public:
46  : zypp::Exception(_("Hal Exception"))
47  {}
48 
54  HalException(const std::string &msg_r)
55  : zypp::Exception(_("Hal Exception"))
56  , e_name()
57  , e_msg(msg_r)
58  {}
59 
63  HalException(const std::string &err_name, const std::string &err_msg)
64  : zypp::Exception(_("Hal Exception"))
65  , e_name(err_name)
66  , e_msg(err_msg)
67  {}
68 
71  virtual ~HalException() throw() {};
72 
76  const std::string & errorName() const
77  {
78  return e_name;
79  }
80 
84  const std::string & errorMessage() const
85  {
86  return e_msg;
87  }
88 
89  protected:
90  virtual std::ostream & dumpOn( std::ostream & str ) const;
91 
92  private:
93  std::string e_name;
94  std::string e_msg;
95  };
96 
99  struct NoHalException: public Exception
100  { NoHalException(); };
101 
103  } // namespace hal
106  } // namespace target
109 } // namespace zypp
111 
112 #endif // ZYPP_TARGET_HAL_HALEXCEPTION_H
113 
114 /*
115 ** vim: set ts=2 sts=2 sw=2 ai et:
116 */