diff --git a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/tools/SessionProvider.java b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/tools/SessionProvider.java index 7bf71c62b7..dca714bfcc 100644 --- a/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/tools/SessionProvider.java +++ b/legend-sdlc-server/src/main/java/org/finos/legend/sdlc/server/tools/SessionProvider.java @@ -134,7 +134,17 @@ public static Session getSessionUsingGitlabPersonalAccessToken(HttpServletReques GitlabPersonalAccessTokenProfileCreator creator = new GitlabPersonalAccessTokenProfileCreator(client.host); GitlabPersonalAccessTokenAuthenticator authenticator = new GitlabPersonalAccessTokenAuthenticator(client.scheme, client.host, client.apiVersion); GitlabPersonalAccessTokenCredentials credentials = extractor.extract(context); - authenticator.validate(credentials, context); + + try + { + authenticator.validate(credentials, context); + } + catch (Exception e) + { + LOGGER.error("Validation failed for PA token", e); + return null; + } + GitlabPersonalAccessTokenProfile profile = creator.create(credentials, context); return GitLabSessionBuilder.newBuilder(appInfo).withProfile(profile).build(); }