libzypp  10.5.0
HalException.h
Go to the documentation of this file.
00001 /*---------------------------------------------------------------------\
00002 |                          ____ _   __ __ ___                          |
00003 |                         |__  / \ / / . \ . \                         |
00004 |                           / / \ V /|  _/  _/                         |
00005 |                          / /__ | | | | | |                           |
00006 |                         /_____||_| |_| |_|                           |
00007 |                                                                      |
00008 \---------------------------------------------------------------------*/
00013 #ifndef ZYPP_TARGET_HAL_HALEXCEPTION_H
00014 #define ZYPP_TARGET_HAL_HALEXCEPTION_H
00015 
00016 #include <zypp/base/Exception.h>
00017 #include <zypp/base/Gettext.h>
00018 #include <zypp/base/String.h>
00019 
00020 
00022 namespace zypp
00023 { 
00024 
00025   namespace target
00026   { 
00027 
00028     namespace hal
00029     { 
00030 
00031 
00033       //
00034       // CLASS NAME : HalException
00035       //
00039       class HalException: public zypp::Exception
00040       {
00041       public:
00045         HalException()
00046           : zypp::Exception(_("Hal Exception"))
00047         {}
00048 
00054         HalException(const std::string &msg_r)
00055           : zypp::Exception(_("Hal Exception"))
00056           , e_name()
00057           , e_msg(msg_r)
00058         {}
00059 
00063         HalException(const std::string &err_name, const std::string &err_msg)
00064           : zypp::Exception(_("Hal Exception"))
00065           , e_name(err_name)
00066           , e_msg(err_msg)
00067         {}
00068 
00071         virtual ~HalException() throw() {};
00072 
00076         const std::string & errorName() const
00077         {
00078           return e_name;
00079         }
00080 
00084         const std::string & errorMessage() const
00085         {
00086           return e_msg;
00087         }
00088 
00089       protected:
00090         virtual std::ostream & dumpOn( std::ostream & str ) const;
00091 
00092       private:
00093         std::string e_name;
00094         std::string e_msg;
00095       };
00096 
00099       struct NoHalException: public Exception
00100       { NoHalException(); };
00101 
00103     } // namespace hal
00106   } // namespace target
00109 } // namespace zypp
00111 
00112 #endif // ZYPP_TARGET_HAL_HALEXCEPTION_H
00113 
00114 /*
00115 ** vim: set ts=2 sts=2 sw=2 ai et:
00116 */