From 26cbc9b884a7fd99f91b74a61e2f507ed9562ebc Mon Sep 17 00:00:00 2001 From: Dayeon-Hong Date: Wed, 5 Jun 2024 16:14:23 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=ED=8C=8C=EC=9D=BC=EB=AA=85=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD=20=ED=9B=84=20=EB=82=A0=EC=94=A8=20=EC=97=90?= =?UTF-8?q?=EB=9F=AC=20=EC=B2=98=EB=A6=AC=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #40 --- .../com/isp/backend/global/exception/ErrorCode.java | 5 +++-- .../AmadeusSearchFailedException.java | 2 +- .../{flight => openApi}/FlightNotFoundException.java | 2 +- .../{flight => openApi}/NotYourFlightException.java | 2 +- .../openApi/OpenWeatherSearchFailedException.java | 12 ++++++++++++ .../SkyScannerGenerateFailedException.java | 2 +- 6 files changed, 19 insertions(+), 6 deletions(-) rename backend/src/main/java/com/isp/backend/global/exception/{flight => openApi}/AmadeusSearchFailedException.java (84%) rename backend/src/main/java/com/isp/backend/global/exception/{flight => openApi}/FlightNotFoundException.java (83%) rename backend/src/main/java/com/isp/backend/global/exception/{flight => openApi}/NotYourFlightException.java (84%) create mode 100644 backend/src/main/java/com/isp/backend/global/exception/openApi/OpenWeatherSearchFailedException.java rename backend/src/main/java/com/isp/backend/global/exception/{flight => openApi}/SkyScannerGenerateFailedException.java (85%) diff --git a/backend/src/main/java/com/isp/backend/global/exception/ErrorCode.java b/backend/src/main/java/com/isp/backend/global/exception/ErrorCode.java index ce6b359b..1b64695c 100644 --- a/backend/src/main/java/com/isp/backend/global/exception/ErrorCode.java +++ b/backend/src/main/java/com/isp/backend/global/exception/ErrorCode.java @@ -27,11 +27,12 @@ public enum ErrorCode { IATA_CODE_NOT_FOUND(HttpStatus.NOT_FOUND, "S005", "해당 국가의 공항 코드를 찾을 수 없습니다."), CHECK_LIST_NOT_FOUND(HttpStatus.NOT_FOUND, "S006", "체크리스트를 찾을 수 없습니다"), - // Flight & Hotel + // Open API AMADEUS_SEARCH_FAILED(HttpStatus.INTERNAL_SERVER_ERROR,"F001", "아마데우스 요청을 가져오는 중 오류를 발생했습니다."), SKY_SCANNER_GENERATE_FAILED(HttpStatus.INTERNAL_SERVER_ERROR,"F002", "스카이스캐너 URL을 생성할 수 없습니다."), FLIGHT_NOT_FOUND(HttpStatus.NOT_FOUND, "F003", "해당 id의 항공권을 찾을 수 없습니다."), - NOT_YOUR_FLIGHT(HttpStatus.UNAUTHORIZED, "F004", "사용자의 항공권이 아닙니다"); + NOT_YOUR_FLIGHT(HttpStatus.UNAUTHORIZED, "F004", "사용자의 항공권이 아닙니다"), + OPEN_WEATHER_SEARCH_FAILED(HttpStatus.NOT_FOUND,"F005", "날씨 정보 파싱에 실패하였습니다"); private HttpStatus status; diff --git a/backend/src/main/java/com/isp/backend/global/exception/flight/AmadeusSearchFailedException.java b/backend/src/main/java/com/isp/backend/global/exception/openApi/AmadeusSearchFailedException.java similarity index 84% rename from backend/src/main/java/com/isp/backend/global/exception/flight/AmadeusSearchFailedException.java rename to backend/src/main/java/com/isp/backend/global/exception/openApi/AmadeusSearchFailedException.java index 2873dadc..bb8e78a1 100644 --- a/backend/src/main/java/com/isp/backend/global/exception/flight/AmadeusSearchFailedException.java +++ b/backend/src/main/java/com/isp/backend/global/exception/openApi/AmadeusSearchFailedException.java @@ -1,4 +1,4 @@ -package com.isp.backend.global.exception.flight; +package com.isp.backend.global.exception.openApi; import com.isp.backend.global.exception.CustomException; import com.isp.backend.global.exception.ErrorCode; diff --git a/backend/src/main/java/com/isp/backend/global/exception/flight/FlightNotFoundException.java b/backend/src/main/java/com/isp/backend/global/exception/openApi/FlightNotFoundException.java similarity index 83% rename from backend/src/main/java/com/isp/backend/global/exception/flight/FlightNotFoundException.java rename to backend/src/main/java/com/isp/backend/global/exception/openApi/FlightNotFoundException.java index 905542a0..ae02bae3 100644 --- a/backend/src/main/java/com/isp/backend/global/exception/flight/FlightNotFoundException.java +++ b/backend/src/main/java/com/isp/backend/global/exception/openApi/FlightNotFoundException.java @@ -1,4 +1,4 @@ -package com.isp.backend.global.exception.flight; +package com.isp.backend.global.exception.openApi; import com.isp.backend.global.exception.CustomException; import com.isp.backend.global.exception.ErrorCode; diff --git a/backend/src/main/java/com/isp/backend/global/exception/flight/NotYourFlightException.java b/backend/src/main/java/com/isp/backend/global/exception/openApi/NotYourFlightException.java similarity index 84% rename from backend/src/main/java/com/isp/backend/global/exception/flight/NotYourFlightException.java rename to backend/src/main/java/com/isp/backend/global/exception/openApi/NotYourFlightException.java index 7c80919e..7db101b2 100644 --- a/backend/src/main/java/com/isp/backend/global/exception/flight/NotYourFlightException.java +++ b/backend/src/main/java/com/isp/backend/global/exception/openApi/NotYourFlightException.java @@ -1,4 +1,4 @@ -package com.isp.backend.global.exception.flight; +package com.isp.backend.global.exception.openApi; import com.isp.backend.global.exception.CustomException; import com.isp.backend.global.exception.ErrorCode; diff --git a/backend/src/main/java/com/isp/backend/global/exception/openApi/OpenWeatherSearchFailedException.java b/backend/src/main/java/com/isp/backend/global/exception/openApi/OpenWeatherSearchFailedException.java new file mode 100644 index 00000000..957fec55 --- /dev/null +++ b/backend/src/main/java/com/isp/backend/global/exception/openApi/OpenWeatherSearchFailedException.java @@ -0,0 +1,12 @@ +package com.isp.backend.global.exception.openApi; + +import com.isp.backend.global.exception.CustomException; +import com.isp.backend.global.exception.ErrorCode; + +public class OpenWeatherSearchFailedException extends CustomException { + + public OpenWeatherSearchFailedException() { + super(ErrorCode.OPEN_WEATHER_SEARCH_FAILED); + } + +} \ No newline at end of file diff --git a/backend/src/main/java/com/isp/backend/global/exception/flight/SkyScannerGenerateFailedException.java b/backend/src/main/java/com/isp/backend/global/exception/openApi/SkyScannerGenerateFailedException.java similarity index 85% rename from backend/src/main/java/com/isp/backend/global/exception/flight/SkyScannerGenerateFailedException.java rename to backend/src/main/java/com/isp/backend/global/exception/openApi/SkyScannerGenerateFailedException.java index 08a5faf4..766f1021 100644 --- a/backend/src/main/java/com/isp/backend/global/exception/flight/SkyScannerGenerateFailedException.java +++ b/backend/src/main/java/com/isp/backend/global/exception/openApi/SkyScannerGenerateFailedException.java @@ -1,4 +1,4 @@ -package com.isp.backend.global.exception.flight; +package com.isp.backend.global.exception.openApi; import com.isp.backend.global.exception.CustomException; import com.isp.backend.global.exception.ErrorCode;