Skip to content

Commit

Permalink
Merge pull request #108 from Central-MakeUs/80-회원-탈퇴를-할-수-있다
Browse files Browse the repository at this point in the history
Fix(#80): 소셜로그인 error 처리 세분화
  • Loading branch information
tmddus2 authored Aug 28, 2024
2 parents beccae1 + ae38593 commit 5e21180
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,11 @@ public Mono<SuccessResponse<LoginDto>> kakaoLogin(String token) {
})
.onErrorResume(err -> {
log.error(err.getMessage());
throw CustomException.of(Error.INVALID_TOKEN_ERROR);
if (err instanceof CustomException) {
return Mono.error(err);
} else {
throw CustomException.of(Error.INVALID_TOKEN_ERROR);
}
});
}

Expand All @@ -117,9 +121,13 @@ public SuccessResponse<LoginDto> appleLogin(String token, String username)
LoginDto loginDto = LoginDto.builder()
.accessToken(jwtToken).build();
return SuccessResponse.of(loginDto);
} catch (Exception e) {
log.error(e.getMessage());
throw CustomException.of(Error.INVALID_TOKEN_ERROR);
} catch (Exception err) {
log.error(err.getMessage());
if (err instanceof CustomException) {
throw err;
} else {
throw CustomException.of(Error.INVALID_TOKEN_ERROR);
}
}
}
}

0 comments on commit 5e21180

Please sign in to comment.