Skip to content

Commit

Permalink
chore: change jwt exception name
Browse files Browse the repository at this point in the history
  • Loading branch information
eastmeet committed Jan 26, 2023
1 parent e4c422c commit c39c78a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ public ResponseEntity<DataResponseDto<?>> registerPost2(Member loginUser,
return new ResponseEntity<>(new DataResponseDto<>(response), HttpStatus.CREATED);
}


@PatchMapping("/edit/{post-id}/{member-id}")
public ResponseEntity<DataResponseDto<?>> editPost(@PathVariable("post-id") @Positive long postId,
@PathVariable("member-id") @Positive long memberId,
Expand Down Expand Up @@ -161,7 +160,7 @@ public ResponseEntity<DataResponseDto<?>> editPost(@PathVariable("post-id") @Pos

}

@GetMapping(value = {"/{post-id}", "/{post-id}/{member-id}"})
@GetMapping(value = {"/details/{post-id}", "/details/{post-id}/{member-id}"})
public ResponseEntity<DataResponseDto<?>> getPost(@PathVariable("post-id") @Positive long postId,
@PathVariable("member-id") Optional<Long> memberId) {
Post post = postService.findPost(postId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public boolean verifyAccessToken(String token) {
throw new TokenUnsupported();
} catch (IllegalArgumentException e) {
log.trace("JWT claims string is empty trace: {}", e);
throw new TokenEmpty();
throw new TokenIllegalArgument();
}
}

Expand All @@ -113,13 +113,13 @@ public boolean verifyRefreshToken(String token) {
throw new TokenMalformed();
} catch (ExpiredJwtException e) {
log.trace("trace Expired JWT token trace: {}", e);
throw new RefreshExpired();
throw new TokenRefreshExpired();
} catch (UnsupportedJwtException e) {
log.trace("Unsupported JWT token trace: {}", e);
throw new TokenUnsupported();
} catch (IllegalArgumentException e) {
log.trace("JWT claims string is empty trace: {}", e);
throw new TokenEmpty();
throw new TokenIllegalArgument();
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.main36.pikcha.global.exception.BusinessLogicException;
import com.main36.pikcha.global.exception.ExceptionCode;

public class TokenEmpty extends BusinessLogicException {
public class TokenIllegalArgument extends BusinessLogicException {

public TokenEmpty() {
public TokenIllegalArgument() {
super(ExceptionCode.TOKEN_ILLEGAL_ARGUMENT.getMessage(), ExceptionCode.TOKEN_ILLEGAL_ARGUMENT);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import com.main36.pikcha.global.exception.BusinessLogicException;
import com.main36.pikcha.global.exception.ExceptionCode;
import net.minidev.json.writer.BeansMapper;

public class RefreshExpired extends BusinessLogicException {
public class TokenRefreshExpired extends BusinessLogicException {

public RefreshExpired() {
public TokenRefreshExpired() {
super(ExceptionCode.REFRESH_TOKEN_EXPIRED.getMessage(),ExceptionCode.REFRESH_TOKEN_EXPIRED);
}
}

0 comments on commit c39c78a

Please sign in to comment.