sirin05137 / CSE364_Project

2 stars 0 forks source link

[NOTE] Error code 용 Test Input & Output #21

Closed yuujinleee closed 3 years ago

yuujinleee commented 3 years ago

Error code 종류

Possible errors thrown by invalid user input.

Table 1 Invalid input errors
Error Code Message Description
InputEmptyError 1 No argument has passed. 2 arguments are required. (InputStr1 InputStr2) Thrown when no input has entered.
InputNumError 2 Only 1 input has passed. 2 arguments are required. Thrown when only 1 input has entered.
InputNumError 3 More than 2 arguments have passed. 2 arguments are required. Thrown when more than 2 inputs have entered.
InputInvalidError 4 Entered genre input is invalid Thrown when the entered genre (combination) is invalid.
InputInvalidError 5 Entered genre (inputString) doesn't exist. ( Invalid word : input_string ) Thrown when the word in the entered genre (combination) is invalid.
Table 2 Invalid input warning
Warning Code Message Description
InputInvalidWarning 6 Entered occupation doesn't exist. Rating by 'other' is shown instead. Thrown when the 2nd input is invalid.
Table 3 No data exist error
Error Code Message Description
NoDBError 7 Rating data matching the input pair doesn't exist. Thrown when there's no available rating data for the genre-occupation input pair. OR When there's no Movie data matching the entered genre (combination).

Error code 용 Test Input

Error code : 1~3 (각각 인풋 0 / 1 / 3개 이상)

// input
java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project
// output
InputEmptyError : No argument has passed. 2 arguments are required. (InputStr1 InputStr2)
Error code: 1

// input
java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project Drama
// output
InputNumError : Only 1 input has passed. 2 arguments are required.
Error code: 2

// input
java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project Drama scientist scientist
// output
InputNumError : More than 2 arguments have passed. 2 arguments are required.
Error code : 3

Error code: 4~6 (현재 코드에 있는 부분에서 프린팅 포맷만 맞추면 될 듯..?)

// 에러4번 output
InputInvalidError : Entered genre input is invalid.
Error code: 4

// 에러5번 output
InputInvalidError : Entered genre (%s) doesn't exist.
Error code: 5

// 에러6번 output
InputInvalidWarning : Entered occupation doesn't exist. Rating by 'other' is shown instead.
~~Error code: 6~~ //이 부분 삭제. display 상에는 없는게 맞는 것 같음

Error code: 7 (장르에 해당하는 영화X)

// input
"War|Crime" Academic 
// output
NoDBError : Movie data matching the entered genre combination doesn't exist.
Error code: 7

Error code: 8 (장르/직업 인풋에 해당하는 rating X)

// input
"Action|Animation|Children's|Sci-Fi|Thriller|War" Homemaker
"Action|Animation|Children's|Sci-Fi|Thriller|War" retired
// output
NoDBError : Rating data matching the input pair doesn't exist.
Error code: 8

_Originally posted by @yuujinleee in https://github.com/sirin05137/CSE364_Project/issues/18#issuecomment-811278004_

참고자료

  1. https://developer.apple.com/documentation/businesschatapi/messages_sent/interactive_messages/authentication/error_codes
  2. Microsoft Error Messages (Design basics)
  3. Exit Codes With Special Meanings
yuujinleee commented 3 years ago

Error code 용 Test Output

4/1 5:16에 테스트한 Output 복붙

Error code : 1~3 (각각 인풋 0 / 1 / 3개 이상)

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project 

InputEmptyError : No argument has passed. 2 arguments are required. (InputStr1 InputStr2)
Error code: 1

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project Drama

InputNumError : Only 1 input has passed. 2 arguments are required.
Error code: 2

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project Drama Scientist Scientist

InputNumError : More than 2 arguments have passed. 2 arguments are required.
Error code: 3

Error code: 4

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project "|Adventure|Action" Scientist          

InputInvalidError : Entered genre input is invalid.
Error code: 4

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project "Adventure|Action|" Scientist 

InputInvalidError : Entered genre input is invalid.
Error code: 4

Error code: 5

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project "Adventure|Action|Horrrror" Scientist

InputInvalidError : Entered genre (horrrror) doesn't exist.
Error code: 5

Error code: 6

약간 마지막 말이 이상한 것 같긴 한데 (실제론 other rating 인데 librarian이라 나와서..?) 큰 문제는 없을 듯?


yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project Adventure Librarian                  

InputInvalidWarning : Entered occupation doesn't exist. Rating by 'other' is shown instead.

The rating of adventure rated by librarian : 3.43


### Error code: 7 (장르에 해당하는 영화X)
> 현재 Error code 8 로 계산 되어서 나옴. 그냥 이렇게 놔두고 설명을 수정하면 될 듯

```bash
yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project "War|Crime" Academic  

NoDBError : Rating data matching the input pair doesn't exist.
Error code: 8 ➡️  7로 수정됌

Error code: 8 (장르/직업 인풋에 해당하는 rating X) ➡️ 7로 수정 (메시지는 8 유지)

yujinlee@Yujins-MacBook-Pro CSE364_Project % java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project "Action|Animation|Children's|Sci-Fi|Thriller|War" retired

NoDBError : Rating data matching the input pair doesn't exist.
Error code: 8 ➡️  7로 수정됌
yuujinleee commented 3 years ago

Error code : 6 자바 수정

프린팅 메시지 수정 -> The rating of adventure rated by other

% java -cp target/cse364-project-1.0-SNAPSHOT.jar group11.project Adventure Librarian                  

InputInvalidWarning : Entered occupation doesn't exist. Rating by 'other' is shown instead.

The rating of adventure rated by other : 3.43
yuujinleee commented 3 years ago

You can check the final version of this info in README