Open
Description
Example code with try-except block covering the entire code block:
How not to do it
try:
# some code here
except:
print("Error occurred")
Example code with more accurate error handling:
How to do it right
# some code here
try:
result = some_function() # function that we expect might raise an exception
except SomeSpecificError as e:
# handle specific error
logging.error(f"Error occurred: {e}")
except Exception as e:
# handle any other unexpected errors
logging.error(f"Unexpected error occurred: {e}")
It is necessary to check the entire code and correct where this occurs.
-
Handlers
-
DatingBot/handlers/users/start_handler.py
Line 23 in decf861
-
DatingBot/handlers/users/start_handler.py
Line 46 in decf861
-
DatingBot/handlers/users/start_handler.py
Line 105 in decf861
-
DatingBot/handlers/users/filters_handler.py
Line 126 in decf861