Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
package com.nowait.applicationuser.exception;

import static com.nowait.common.exception.ErrorMessage.*;
import static org.springframework.http.HttpStatus.FORBIDDEN;
import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
import static org.springframework.http.HttpStatus.BAD_REQUEST;
import static org.springframework.http.HttpStatus.NOT_FOUND;
import static org.springframework.http.HttpStatus.*;
import static org.springframework.http.HttpStatus.UNAUTHORIZED;

import java.util.Map;
Expand Down Expand Up @@ -35,6 +32,7 @@
import com.nowait.domaincorerdb.reservation.exception.ReservationNotFoundException;
import com.nowait.domaincorerdb.store.exception.StoreNotFoundException;
import com.nowait.domaincorerdb.store.exception.StoreWaitingDisabledException;
import com.nowait.domaincorerdb.storepayment.exception.StorePaymentNotFoundException;
import com.nowait.domaincorerdb.token.exception.BusinessException;
import com.nowait.domaincorerdb.user.exception.UserNotFoundException;
import com.nowait.domainuserrdb.bookmark.exception.AlreadyDeletedBookmarkException;
Expand Down Expand Up @@ -238,6 +236,14 @@ public ErrorResponse handleStoreNotFoundException(StoreNotFoundException e, WebR
return new ErrorResponse(e.getMessage(), STORE_NOT_FOUND.getCode());
}

@ResponseStatus(NO_CONTENT)
@ExceptionHandler(StorePaymentNotFoundException.class)
public ErrorResponse handleStorePaymentNotFoundException(StorePaymentNotFoundException e, WebRequest request) {
alarm(e, request);
log.error("handleStorePaymentNotFoundException", e);
return new ErrorResponse(e.getMessage(), STORE_PAYMENT_NOT_FOUND.getCode());
}

// 공통 에러 Map 생성
private static Map<String, String> getErrors(MethodArgumentNotValidException e) {
return e.getBindingResult()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,12 @@ public ResponseEntity<?> getStorePaymentByStoreId(@PathVariable Long storeId) {
);
} else {
return ResponseEntity
.status(HttpStatus.NO_CONTENT)
.status(HttpStatus.OK)
.body(
ApiUtils.success(
response
"해당 주점의 등록된 결제 정보가 존재하지 않습니다."
)
);
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

public class StorePaymentNotFoundException extends RuntimeException {
public StorePaymentNotFoundException() {
super(ErrorMessage.STORE_PAYMENT_PARAMETER_EMPTY.getMessage());
super(ErrorMessage.STORE_PAYMENT_NOT_FOUND.getMessage());
}
}