Bug 564 - Input validation problem not handled
Summary: Input validation problem not handled
Status: RESOLVED FIXED
Alias: None
Product: New-Territories-Cycle-Track-Navigation-System
Classification: Unclassified
Component: ClimbingMode (show other bugs)
Version: 1.0
Hardware: PC Windows
: --- major
Assignee: xuntanye2-c
URL:
Depends on:
Blocks:
 
Reported: 2021-11-14 21:13 HKT by xuntanye2-c
Modified: 2021-12-01 10:31 HKT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description xuntanye2-c 2021-11-14 21:13:00 HKT
Summary: The input validation functions are not added for the climbing mode functions 
Steps to reproduce:
For the climbing mode functions, when choosing the criteria, input a letter such as "a" will cause Java InputMismatchException. The program will fail.


Actual Output: InputMismatchException. THe program fails
Expected Output: An error message and ask to reinput
Comment 1 xuntanye2-c 2021-12-01 10:31:50 HKT
Solution:
Different Exception handling classes such as ExInvalidCommand and ExWrongNumberFormat are used. Use a try catch clause to capture the exception solves the problem