1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/target/hal/HalException.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"
17 #include "zypp/base/String.h"
19 //////////////////////////////////////////////////////////////////////
21 { ////////////////////////////////////////////////////////////////////
22 ////////////////////////////////////////////////////////////////////
24 { //////////////////////////////////////////////////////////////////
25 //////////////////////////////////////////////////////////////////
27 { ////////////////////////////////////////////////////////////////
30 ////////////////////////////////////////////////////////////////
32 // CLASS NAME : HalException
34 /** Hardware abstaction layer exception.
35 * Just inherits Exception to separate hal exceptions.
37 class HalException: public zypp::Exception
40 /** Default constructor.
41 * Use \ref ZYPP_THROW to throw exceptions.
45 /** Constructor taking complete hal error message.
46 * This constructor is used to generate custom error
47 * messages, in case, that no DBUS error is avaliable.
48 * Use \ref ZYPP_THROW to throw exceptions.
50 HalException(const std::string &msg_r);
52 /** Constructor taking HAL (DBUS) error message components.
53 * Use \ref ZYPP_THROW to throw exceptions.
55 HalException(const std::string &err_name, const std::string &err_msg);
59 virtual ~HalException() throw() {};
62 * \return The HAL (DBUS) error name component.
64 const std::string & errorName() const
70 * \return The HAL (DBUS) error message component.
72 const std::string & errorMessage() const
78 virtual std::ostream & dumpOn( std::ostream & str ) const;
85 /** Exception thrown if we were built without hal support (-DNO_HAL).
87 struct NoHalException: public Exception
88 { NoHalException(); };
90 ////////////////////////////////////////////////////////////////
92 //////////////////////////////////////////////////////////////////
93 //////////////////////////////////////////////////////////////////
95 ////////////////////////////////////////////////////////////////////
96 ////////////////////////////////////////////////////////////////////
98 //////////////////////////////////////////////////////////////////////
100 #endif // ZYPP_TARGET_HAL_HALEXCEPTION_H
103 ** vim: set ts=2 sts=2 sw=2 ai et: