这是indexloc提供的服务,不要输入任何密码
Skip to content

Handle correctly git errors walking objects #367

@ajnavarro

Description

@ajnavarro

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

  1. Create a new Exception, RepositoryException that receives in the constructor the repository that is causing the error and the parent exception.

  2. Add to ChainableIterator the repository instance, so all the iterators that extend from that one should add the repository instance to the parent.

  3. Remove all the specific catch from object iterators and move them to ChainableIterator. We need to catch IncorrectObjectTypeException, MissingObjectException, RevWalkException and GitAPIExceptionon next() and hasNext() methods. Encapsulate that errors on a RepositoryException mentioned above.

  4. 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-- ?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions