-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Right now, if the repository has some missing objects when walking the objects, depending on which object is missed, the error is correctly handled or not.
To avoid that, we need to handle the error in the same way.
Proposal
-
Create a new Exception,
RepositoryExceptionthat receives in the constructor the repository that is causing the error and the parent exception. -
Add to
ChainableIteratorthe repository instance, so all the iterators that extend from that one should add the repository instance to the parent. -
Remove all the specific catch from object iterators and move them to
ChainableIterator. We need to catchIncorrectObjectTypeException,MissingObjectException,RevWalkExceptionandGitAPIExceptiononnext()andhasNext()methods. Encapsulate that errors on aRepositoryExceptionmentioned above. -
Add a configuration variable, to configure if you want to throw the exception or just log it (as default it will just log the error).
Also, I will add tests for this use cases, mocking the Repository object to throw that errors.
Caveats @smola @mcarmonaa @jfontan @erizocosmico @kuba-- ?