From a156286a9dfd4c8d066c8a38e8cce87d47695b5d Mon Sep 17 00:00:00 2001 From: Max_Zhukov Date: Sat, 27 Jul 2024 18:10:07 +0300 Subject: [PATCH] Handling expired token and other api errors --- Zero-Tool/ip-lookup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Zero-Tool/ip-lookup.py b/Zero-Tool/ip-lookup.py index c0f8e8d..9b341ac 100644 --- a/Zero-Tool/ip-lookup.py +++ b/Zero-Tool/ip-lookup.py @@ -22,5 +22,7 @@ def print_phone_details(phone_details): phone_number = input(Fore.MAGENTA+"Enter the phone number to locate: ") -phone_details = phone_locator(phone_number, api_key) -print_phone_details(phone_details) \ No newline at end of file +if len(phone_details) <= 1: + print(Fore.RED+f"Error message: {phone_details['message']}") +else: + print_phone_details(phone_details)