00001
00002
00003
00004
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 <string>
00018
00019
00021 namespace zypp
00022 {
00023
00024 namespace target
00025 {
00026
00027 namespace hal
00028 {
00029
00030
00032
00033
00034
00038 class HalException: public zypp::Exception
00039 {
00040 public:
00044 HalException()
00045 : zypp::Exception("Hal Exception")
00046 {}
00047
00053 HalException(const std::string &msg_r)
00054 : zypp::Exception("Hal Exception: " + msg_r)
00055 {}
00056
00060 HalException(const std::string &err_name, const std::string &err_msg)
00061 : zypp::Exception("Hal Exception")
00062 , e_name(err_name)
00063 , e_msg(err_msg)
00064 {}
00065
00068 virtual ~HalException() throw() {};
00069
00073 const std::string & errorName() const
00074 {
00075 return e_name;
00076 }
00077
00081 const std::string & errorMessage() const
00082 {
00083 return e_msg;
00084 }
00085
00086 protected:
00087 virtual std::ostream & dumpOn( std::ostream & str ) const;
00088
00089 private:
00090 std::string e_name;
00091 std::string e_msg;
00092 };
00093
00094
00096 }
00099 }
00102 }
00104
00105 #endif // ZYPP_TARGET_HAL_HALEXCEPTION_H
00106
00107
00108
00109