itzg / itzg/discord-github-melder-bot

Simplify 401 error log when accessing github webhook config

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
4
Forks
0
PR merge metrics
No merged PRs in 30d

Description

Right now a 401 from github logs with the full stack trace, shown below. It would be nice to report just the 401 and an explanation that the configured token has probably expired (which was the case below).

```
2022-02-25 01:45:15.684 ERROR 1 --- [or-http-epoll-1] reactor.core.publisher.Operators : Operator called default onErrorDropped

org.springframework.web.reactive.function.client.WebClientResponseException$Unauthorized: 401 Unauthorized from GET https://api.github.com/repos/itzg/mc-router/hooks
at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:198) ~[spring-webflux-5.3.15.jar:5.3.15]
Suppressed: reactor.core.publisher.FluxOnAssembly$OnAssemblyException:
Error has been observed at the following site(s):
*__checkpoint ⇢ 401 from GET https://api.github.com/repos/itzg/mc-router/hooks [DefaultWebClient]
*__checkpoint ⇢ Get webhooks from itzg/mc-router
Original Stack Trace:
at org.springframework.web.reactive.function.client.WebClientResponseException.create(WebClientResponseException.java:198) ~[spring-webflux-5.3.15.jar:5.3.15]
at org.springframework.web.reactive.function.client.DefaultClientResponse.lambda$createException$1(DefaultClientResponse.java:207) ~[spring-webflux-5.3.15.jar:5.3.15]
at reactor.core.publisher.FluxMap$MapSubscriber.onNext(FluxMap.java:106) ~[reactor-core-3.4.14.jar:3.4.14]
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onNext(FluxOnErrorResume.java:79) ~[reactor-core-3.4.14.jar:3.4.14]
at reactor.core.publisher.FluxDefaultIfEmpty$DefaultIfEmptySubscriber.onNext(FluxDefaultIfEmpty.java:101) ~[reactor-core-3.4.14.jar:3.4.14]
at reactor.core.publisher.FluxMapFuseable$MapFuseableSubscriber.onNext(FluxMapFuseable.java:127) ~[reactor-core-3.4.14.jar:3.4.14]
at reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber.onNext(FluxContextWrite.java:107) ~[reactor-core-3.4.14.jar:3.4.14]
at reactor.core.publisher.FluxMapFuseable$MapFuseableConditionalSubscriber.onNext(FluxMapFuseable.java:295) ~[reactor-core-3.4.14.jar:3.4.14]
at reactor.core.publisher.FluxFilterFuseable$FilterFuseableConditionalSubscriber.onNext(FluxFilterFuseable.java:337) ~[reactor-core-3.4.14.jar:3.4.14]
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the GitHub webhook configuration request for GET https://api.github.com/repos/itzg/mc-router/hooks and its Spring WebFlux error logging path. Confirm how a 401 is currently propagated, then verify that an expired token produces a concise 401 explanation without the full stack trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
github, java, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.