-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MARP-1059 market website rating does not work after login #140
MARP-1059 market website rating does not work after login #140
Conversation
…es-not-work-after-login
…es-not-work-after-login
…es-not-work-after-login
} catch (Exception e) { | ||
return new ResponseEntity<>(Map.of(e.getClass().getName(), e.getMessage()), HttpStatus.BAD_REQUEST); | ||
return new ResponseEntity<>(Map.of(CommonConstants.MESSAGE, e.getMessage()), HttpStatus.BAD_REQUEST); | ||
} | ||
|
||
User user = gitHubService.getAndUpdateUser(accessToken); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this block code to try {}
@@ -110,7 +111,8 @@ public GitHubAccessTokenResponse getAccessToken(String code, GitHubProperty gitH | |||
GitHubAccessTokenResponse response = responseEntity.getBody(); | |||
|
|||
if (response != null && response.getError() != null && !response.getError().isBlank()) { | |||
throw new Oauth2ExchangeCodeException(response.getError(), response.getErrorDescription()); | |||
String errorDescription = buildErrorDescription(response.getErrorDescription(), gitHubProperty.getOauth2ClientId()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should write a log and not throw exception with this info.
@@ -110,7 +111,8 @@ public GitHubAccessTokenResponse getAccessToken(String code, GitHubProperty gitH | |||
GitHubAccessTokenResponse response = responseEntity.getBody(); | |||
|
|||
if (response != null && response.getError() != null && !response.getError().isBlank()) { | |||
throw new Oauth2ExchangeCodeException(response.getError(), response.getErrorDescription()); | |||
String errorDescription = buildErrorDescription(response.getErrorDescription(), gitHubProperty.getOauth2ClientId()); | |||
throw new Oauth2ExchangeCodeException(response.getError(), errorDescription); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should write a test for this Exception with ExceptionHandlers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.