Pathname solvfile = (_pimpl->options.repoCachePath / alias).extend(".solv");
if ( ! PathInfo(solvfile).isExist() )
- ZYPP_THROW(RepoNotCachedException());
+ ZYPP_THROW(RepoNotCachedException(info));
try
{
++it )
{
if ( info.alias() == (*it).alias() )
- ZYPP_THROW(RepoAlreadyExistsException(info.alias()));
+ ZYPP_THROW(RepoAlreadyExistsException(info));
}
RepoInfo tosave = info;
if ( (*it).alias() == (*kit).alias() )
{
ERR << "To be added repo " << (*it).alias() << " conflicts with existing repo " << (*kit).alias() << endl;
- ZYPP_THROW(RepoAlreadyExistsException((*it).alias()));
+ ZYPP_THROW(RepoAlreadyExistsException(*it));
}
}
}
++it )
{
if ( newinfo.alias() == (*it).alias() )
- ZYPP_THROW(RepoAlreadyExistsException(newinfo.alias()));
+ ZYPP_THROW(RepoAlreadyExistsException(newinfo));
}
}
: Exception( msg_r )
{}
- RepoNotCachedException::RepoNotCachedException()
- : RepoException( "Repository not Cached" )
+ RepoException::RepoException( const RepoInfo & info )
+ : Exception( "Repo exception" ), _info( info )
{}
- RepoNotCachedException::RepoNotCachedException( const std::string & msg_r )
- : RepoException( msg_r )
+ RepoException::RepoException( const RepoInfo & info,
+ const std::string& msg_r )
+ : Exception( msg_r ), _info( info )
+ {}
+
+ RepoNotCachedException::RepoNotCachedException( const RepoInfo& info )
+ : RepoException( info, "Repository not Cached" )
+ {}
+
+ RepoNotCachedException::RepoNotCachedException( const RepoInfo& info,
+ const std::string & msg_r )
+ : RepoException( info, msg_r )
{}
RepoException();
/** Ctor */
RepoException( const std::string & msg_r );
+
+ RepoException( const RepoInfo & info );
+
+ RepoException( const RepoInfo & info, const std::string & msg_r );
+
+ virtual ~RepoException() throw() {}
+
+ RepoInfo info()
+ { return _info; }
+
protected:
virtual std::ostream & dumpOn( std::ostream & str ) const;
+
+ private:
+ RepoInfo _info;
};
///////////////////////////////////////////////////////////////////
class RepoNotCachedException : public RepoException
{
public:
- RepoNotCachedException();
- RepoNotCachedException( const std::string & msg_r );
+ RepoNotCachedException( const RepoInfo& info );
+ RepoNotCachedException( const RepoInfo& info, const std::string & msg_r );
};
/**
{}
RepoNoUrlException( const RepoInfo &info)
- : _info(info)
- {}
+ : RepoException(info)
+ {}
- ~RepoNoUrlException() throw()
- {}
-
- RepoInfo info()
- { return _info; }
- private:
- RepoInfo _info;
};
/**
{
public:
RepoNotFoundException( const RepoInfo &info)
- : _info(info)
- {}
- ~RepoNotFoundException() throw()
+ : RepoException(info)
{}
-
- RepoInfo info()
- { return _info; }
- private:
- RepoInfo _info;
};
/**
class RepoAlreadyExistsException : public RepoException
{
public:
- ~RepoAlreadyExistsException() throw()
- {}
-
- RepoAlreadyExistsException( const std::string &alias,
+ RepoAlreadyExistsException( const RepoInfo &info,
const std::string & msg_r )
- : RepoException(msg_r)
- , _alias(alias)
+ : RepoException(info,msg_r)
{}
- RepoAlreadyExistsException( const std::string &alias )
- : _alias(alias)
+ RepoAlreadyExistsException( const RepoInfo &info )
+ : RepoException(info)
{}
std::string alias()
- { return _alias; }
-
- private:
- std::string _alias;
+ { return info().alias(); }
};
/**
RepoUnknownTypeException()
{}
- ~RepoUnknownTypeException() throw()
- {}
};
/**
{
public:
RepoMetadataException( const RepoInfo &info)
- : _info(info)
+ : RepoException(info)
{}
RepoMetadataException()
{}
-
- ~RepoMetadataException() throw()
- {}
-
- RepoInfo info()
- { return _info; }
- private:
- RepoInfo _info;
};
/////////////////////////////////////////////////////////////////
Url url;
- RepoException repo_excpt(str::form(_("Can't provide file '%s' from repository '%s'"),
+ RepoException repo_excpt(repo_r,
+ str::form(_("Can't provide file '%s' from repository '%s'"),
loc_r.filename().c_str(),
repo_r.alias().c_str() ) );