github-plugin icon indicating copy to clipboard operation
github-plugin copied to clipboard

Prevent stacktrace when there are no admin credentials

Open carlossg opened this issue 7 years ago • 2 comments

To keep logs cleaner

Instead of

Dec 10, 2016 10:31:51 PM WARNING org.jenkinsci.plugins.github.webhook.WebhookManager$2 applyNullSafe
Failed to add GitHub webhook for GitHubRepositoryName[host=github.com,username=doublesharp,repository=PRIVATE_PROJECT]
java.lang.NullPointerException: There is no credentials with admin access to manage hooks on GitHubRepositoryName[host=github.com,username=doublesharp,repository=PRIVATE_PROJECT]
	at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:231)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:156)
	at org.jenkinsci.plugins.github.webhook.WebhookManager$2.applyNullSafe(WebhookManager.java:152)
	at org.jenkinsci.plugins.github.util.misc.NullSafeFunction.apply(NullSafeFunction.java:18)

This change is Reviewable

carlossg avatar Apr 07 '18 13:04 carlossg

So it changes behaviour, now instead exception it will return null. May be good, but not sure how change will influence on plugins

KostyaSha avatar Sep 19 '18 14:09 KostyaSha

btw, #206 may be related

KostyaSha avatar Feb 09 '19 02:02 KostyaSha