Skip to content
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

Conversation

ndkhanh-axonivy
Copy link
Contributor

No description provided.

@github-actions github-actions bot added the bug Something isn't working label Sep 11, 2024
} 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);
Copy link
Contributor

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());
Copy link
Contributor

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);
Copy link
Contributor

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.

Copy link
Contributor

@phhung-axonivy phhung-axonivy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ndkhanh-axonivy ndkhanh-axonivy merged commit 80b87f7 into develop Sep 16, 2024
6 checks passed
@ndkhanh-axonivy ndkhanh-axonivy deleted the bugfix/MARP-1059-Market-website-Rating-does-not-work-after-login branch September 16, 2024 04:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants