HunxByts / GhostTrack

Useful tool to track location or mobile number
901 stars 115 forks source link

Error Handling for Non-Numeric Input in IP Target Field (Option 1) #10

Open juampaweb opened 1 month ago

juampaweb commented 1 month ago

When attempting to add a string (non-numeric) in the "IP Target" field under option 1, an error is thrown. This error should be addressed to provide informative feedback to the user regarding the invalid IP input. This will enable users to re-enter a valid IP address or return to the main menu.

Steps to Reproduce:

Navigate to option 1. Input a string (non-numeric) in the "IP Target" field. Observe the error.

Expected Behavior: When a non-numeric input is detected in the "IP Target" field, the system should provide a clear and descriptive error message informing the user that the entered IP is invalid. The message should prompt the user to either re-enter a valid IP address or return to the main menu.

Additional Information: This issue affects user experience by preventing seamless interaction with the application. Implementing proper error handling will enhance usability and reduce user frustration. Consider providing examples of valid IP formats to assist users in entering correct input.

Describe error:

 Enter IP target : pepe

 ============= SHOW INFORMATION IP ADDRESS =============

 IP target       : pepe
Traceback (most recent call last):
  File "/var/www/html/utils/GhostTrack/GhostTR.py", line 311, in <module>
    main()
  File "/var/www/html/utils/GhostTrack/GhostTR.py", line 302, in main
    execute_option(opt)
  File "/var/www/html/utils/GhostTrack/GhostTR.py", line 232, in execute_option
    call_option(opt)
  File "/var/www/html/utils/GhostTrack/GhostTR.py", line 225, in call_option
    option['func']()
  File "/var/www/html/utils/GhostTrack/GhostTR.py", line 33, in wrapper
    func(*args, **kwargs)
  File "/var/www/html/utils/GhostTrack/GhostTR.py", line 49, in IP_Track
    print(f"{Wh} Type IP         :{Gr}", ip_data["type"])
KeyError: 'type'
(.venv)  utils/GhostTrack $