1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/hal/HalContext.h
11 * \brief Hardware abstaction layer library wrapper.
13 #ifndef ZYPP_TARGET_HAL_HALEXCEPTION_H
14 #define ZYPP_TARGET_HAL_HALEXCEPTION_H
16 #include <zypp/base/Exception.h>
20 //////////////////////////////////////////////////////////////////////
22 { ////////////////////////////////////////////////////////////////////
23 ////////////////////////////////////////////////////////////////////
25 { //////////////////////////////////////////////////////////////////
26 //////////////////////////////////////////////////////////////////
28 { ////////////////////////////////////////////////////////////////
31 ////////////////////////////////////////////////////////////////
33 // CLASS NAME : HalException
35 /** Hardware abstaction layer exception.
36 * Just inherits Exception to separate hal exceptions.
38 class HalException: public zypp::Exception
41 /** Default constructor.
42 * Use \ref ZYPP_THROW to throw exceptions.
45 : zypp::Exception("Hal Exception")
48 /** Constructor taking complete hal error message.
49 * This constructor is used to generate custom error
50 * messages, in case, that no DBUS error is avaliable.
51 * Use \ref ZYPP_THROW to throw exceptions.
53 HalException(const std::string &msg_r)
54 : zypp::Exception("Hal Exception: " + msg_r)
57 /** Constructor taking HAL (DBUS) error message components.
58 * Use \ref ZYPP_THROW to throw exceptions.
60 HalException(const std::string &err_name, const std::string &err_msg)
61 : zypp::Exception("Hal Exception")
68 virtual ~HalException() throw() {};
71 * \return The HAL (DBUS) error name component.
73 const std::string & errorName() const
79 * \return The HAL (DBUS) error message component.
81 const std::string & errorMessage() const
87 virtual std::ostream & dumpOn( std::ostream & str ) const;
95 ////////////////////////////////////////////////////////////////
97 //////////////////////////////////////////////////////////////////
98 //////////////////////////////////////////////////////////////////
100 ////////////////////////////////////////////////////////////////////
101 ////////////////////////////////////////////////////////////////////
103 //////////////////////////////////////////////////////////////////////
105 #endif // ZYPP_TARGET_HAL_HALEXCEPTION_H
108 ** vim: set ts=2 sts=2 sw=2 ai et: