00001 /*---------------------------------------------------------------------\ 00002 | ____ _ __ __ ___ | 00003 | |__ / \ / / . \ . \ | 00004 | / / \ V /| _/ _/ | 00005 | / /__ | | | | | | | 00006 | /_____||_| |_| |_| | 00007 | | 00008 \---------------------------------------------------------------------*/ 00012 #ifndef ZYPP_REPO_REPOEXCEPTION_H 00013 #define ZYPP_REPO_REPOEXCEPTION_H 00014 00015 #include <iosfwd> 00016 #include <string> 00017 00018 #include "zypp/base/Exception.h" 00019 #include "zypp/base/UserRequestException.h" 00020 #include "zypp/RepoInfo.h" 00022 namespace zypp 00023 { 00024 00025 namespace repo 00026 { 00027 00031 class RepoException : public Exception 00032 { 00033 public: 00035 RepoException(); 00037 RepoException( const std::string & msg_r ); 00038 protected: 00039 virtual std::ostream & dumpOn( std::ostream & str ) const; 00040 }; 00042 00048 class RepoNotCachedException : public RepoException 00049 { 00050 public: 00051 RepoNotCachedException(); 00052 RepoNotCachedException( const std::string & msg_r ); 00053 }; 00054 00059 class RepoNoUrlException : public RepoException 00060 { 00061 public: 00062 RepoNoUrlException() 00063 {} 00064 00065 RepoNoUrlException( const RepoInfo &info) 00066 : _info(info) 00067 {} 00068 00069 ~RepoNoUrlException() throw() 00070 {} 00071 00072 RepoInfo info() 00073 { return _info; } 00074 private: 00075 RepoInfo _info; 00076 }; 00077 00082 class RepoNoAliasException : public RepoException 00083 { 00084 00085 }; 00086 00091 class RepoNotFoundException : public RepoException 00092 { 00093 public: 00094 RepoNotFoundException( const RepoInfo &info) 00095 : _info(info) 00096 {} 00097 ~RepoNotFoundException() throw() 00098 {} 00099 00100 RepoInfo info() 00101 { return _info; } 00102 private: 00103 RepoInfo _info; 00104 }; 00105 00110 class RepoAlreadyExistsException : public RepoException 00111 { 00112 public: 00113 ~RepoAlreadyExistsException() throw() 00114 {} 00115 00116 RepoAlreadyExistsException( const std::string &alias, 00117 const std::string & msg_r ) 00118 : RepoException(msg_r) 00119 , _alias(alias) 00120 {} 00121 00122 RepoAlreadyExistsException( const std::string &alias ) 00123 : _alias(alias) 00124 {} 00125 00126 std::string alias() 00127 { return _alias; } 00128 00129 private: 00130 std::string _alias; 00131 }; 00132 00137 class RepoUnknownTypeException : public RepoException 00138 { 00139 public: 00140 RepoUnknownTypeException( const std::string & msg_r ) 00141 : RepoException(msg_r) 00142 {} 00143 00144 RepoUnknownTypeException() 00145 {} 00146 00147 ~RepoUnknownTypeException() throw() 00148 {} 00149 }; 00150 00155 class RepoMetadataException : public RepoException 00156 { 00157 public: 00158 RepoMetadataException( const RepoInfo &info) 00159 : _info(info) 00160 {} 00161 00162 RepoMetadataException() 00163 {} 00164 00165 ~RepoMetadataException() throw() 00166 {} 00167 00168 RepoInfo info() 00169 { return _info; } 00170 private: 00171 RepoInfo _info; 00172 }; 00173 00175 } // namespace parser 00178 } // namespace zypp 00180 #endif // ZYPP_PARSER_TAGFILE_PARSEEXCEPTION_H
1.5.3