File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/kotlin/net/leanix/githubagent/config Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,19 @@ class WebSocketClientConfig(
2525 private val leanIXProperties : LeanIXProperties ,
2626 private val gitHubEnterpriseProperties : GitHubEnterpriseProperties
2727) {
28+ private val logger = org.slf4j.LoggerFactory .getLogger(WebSocketClientConfig ::class .java)
29+
2830 @Retry(name = " ws_init_session" )
2931 fun initSession (): StompSession {
3032 val headers = WebSocketHttpHeaders ()
3133 val stompHeaders = StompHeaders ()
32- stompHeaders[" Authorization" ] = " Bearer ${leanIXAuthService.getBearerToken()} "
34+ stompHeaders[" Authorization" ] = runCatching {
35+ " Bearer ${leanIXAuthService.getBearerToken()} "
36+ }.getOrElse {
37+ logger.error(" Failed to get Bearer token for WebSocket connection, please check your Technical User token" )
38+ logger.info(" Retrying to connect..." )
39+ throw it
40+ }
3341 stompHeaders[" GitHub-Enterprise-URL" ] = gitHubEnterpriseProperties.baseUrl
3442 stompHeaders[" GitHub-Agent-Version" ] = GITHUB_AGENT_VERSION
3543 return stompClient().connectAsync(
You can’t perform that action at this time.
0 commit comments