I did some digging on this and it is not particularly easy.
I'd love to be able to simply catch and swallow some error locally, but if we do that it may result in jobs being deleted (or marked for deletion) simply because there was an error while reading them. I looked pretty carefully and I didn't see a way to address this safely in a small/local change.
The core problem is that the code that controls how child items are created and maintained is spread across several other plugins, including folders, scm-api and branch-api.
My thought is that we'll need to add a no-op preserve(String itemName) method to SCMHeadObserver.
Then we can wire through an implementation in MultiBranchProject.SCMHeadObserverImpl.
Finally, we'd expose that in github-branch-source for the GitHubSCMSource to call when an error occurs.
I did some digging on this and it is not particularly easy.
I'd love to be able to simply catch and swallow some error locally, but if we do that it may result in jobs being deleted (or marked for deletion) simply because there was an error while reading them. I looked pretty carefully and I didn't see a way to address this safely in a small/local change.
The core problem is that the code that controls how child items are created and maintained is spread across several other plugins, including folders, scm-api and branch-api.
My thought is that we'll need to add a no-op preserve(String itemName) method to SCMHeadObserver.
Then we can wire through an implementation in MultiBranchProject.SCMHeadObserverImpl.
Finally, we'd expose that in github-branch-source for the GitHubSCMSource to call when an error occurs.