Skip to content

Commit

Permalink
feat : 항공권 관련 error 코드 생성
Browse files Browse the repository at this point in the history
  • Loading branch information
Dayon-Hong committed May 12, 2024
1 parent dd1a8c8 commit 961fedf
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,19 @@ public enum ErrorCode {
MEMBER_NOT_ACTIVATED(HttpStatus.BAD_REQUEST, "U003", "사용자가 활성화 상태가 아닙니다."),
ACCESS_TOKEN_IS_INVALID(HttpStatus.UNAUTHORIZED, "U004", "엑세스 토큰이 유효하지 않습니다."),
REFRESH_TOKEN_IS_INVALID(HttpStatus.UNAUTHORIZED, "U005", "리프레시 토큰이 유효하지 않습니다."),

// Schedule
COUNTRY_NOT_FOUND(HttpStatus.NOT_FOUND, "S001", "여행할 국가를 찾을 수 없습니다."),
SCHEDULE_NOT_FOUND(HttpStatus.NOT_FOUND, "S002", "여행 일정을 찾을 수 없습니다."),
NOT_YOUR_SCHEDULE(HttpStatus.UNAUTHORIZED, "S003", "사용자의 여행 일정이 아닙니다."),
IMAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "S004", "이미지를 찾을 수 없습니다.");
IMAGE_NOT_FOUND(HttpStatus.NOT_FOUND, "S004", "이미지를 찾을 수 없습니다."),
IATA_CODE_NOT_FOUND(HttpStatus.NOT_FOUND, "S005", "해당 국가의 공항 코드를 찾을 수 없습니다."),

// Flight
FLIGHT_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", "사용자의 항공권이 아닙니다");


private HttpStatus status;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package com.isp.backend.global.exception.flight;

import com.isp.backend.global.exception.CustomException;
import com.isp.backend.global.exception.ErrorCode;

public class FlightNotFoundException extends CustomException {

public FlightNotFoundException() {super(ErrorCode.FLIGHT_NOT_FOUND);}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.isp.backend.global.exception.flight;

import com.isp.backend.global.exception.CustomException;
import com.isp.backend.global.exception.ErrorCode;

public class FlightSearchFailedException extends CustomException {

public FlightSearchFailedException() {
super(ErrorCode.FLIGHT_SEARCH_FAILED);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.isp.backend.global.exception.flight;

import com.isp.backend.global.exception.CustomException;
import com.isp.backend.global.exception.ErrorCode;

public class NotYourFlightException extends CustomException {

public NotYourFlightException() {
super(ErrorCode.NOT_YOUR_FLIGHT);
}

}


Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.isp.backend.global.exception.flight;

import com.isp.backend.global.exception.CustomException;
import com.isp.backend.global.exception.ErrorCode;

public class SkyScannerGenerateFailedException extends CustomException {

public SkyScannerGenerateFailedException() {
super(ErrorCode.SKY_SCANNER_GENERATE_FAILED);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package com.isp.backend.global.exception.schedule;

import com.isp.backend.global.exception.CustomException;
import com.isp.backend.global.exception.ErrorCode;

public class IataCodeNotFoundException extends CustomException {

public IataCodeNotFoundException() {
super(ErrorCode.IATA_CODE_NOT_FOUND);
}

}

0 comments on commit 961fedf

Please sign in to comment.