Bug 564

Summary: Input validation problem not handled
Product: New-Territories-Cycle-Track-Navigation-System Reporter: xuntanye2-c
Component: ClimbingModeAssignee: xuntanye2-c
Status: RESOLVED FIXED    
Severity: major    
Priority: ---    
Version: 1.0   
Hardware: PC   
OS: Windows   

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