-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Priority: LowThis issue can probably be picked up by anyone looking to contribute to the project, as an entry fixThis issue can probably be picked up by anyone looking to contribute to the project, as an entry fixStatus: BlockedAnother prior issue or need for specific input to make progress. External blockers may also existAnother prior issue or need for specific input to make progress. External blockers may also existType: Difficulta long problem and a difficult onea long problem and a difficult one
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
-
try: -
DatingBot/handlers/users/start_handler.py
Line 23 in decf861
try: -
DatingBot/handlers/users/start_handler.py
Line 46 in decf861
try: -
DatingBot/handlers/users/start_handler.py
Line 105 in decf861
try: -
try: -
try: -
try: -
try: -
try: -
try: -
try: -
try: -
DatingBot/handlers/users/filters_handler.py
Line 126 in decf861
try: -
try:
Metadata
Metadata
Assignees
Labels
Priority: LowThis issue can probably be picked up by anyone looking to contribute to the project, as an entry fixThis issue can probably be picked up by anyone looking to contribute to the project, as an entry fixStatus: BlockedAnother prior issue or need for specific input to make progress. External blockers may also existAnother prior issue or need for specific input to make progress. External blockers may also existType: Difficulta long problem and a difficult onea long problem and a difficult one