Skip to content

Commit ba3b3b6

Browse files
Refactor entrypoint to improve error handling and execution flow
- Added a main guard to the entrypoint function to ensure proper execution when the script is run directly. - Enhanced error handling by wrapping the main execution in a try-except block, allowing for better management of exceptions.
1 parent ab89928 commit ba3b3b6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

collider/entrypoint.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,3 +142,10 @@ def entrypoint() -> None:
142142
sys.exit(main())
143143
except Exception as e:
144144
error_handler(e)
145+
146+
147+
if __name__ == '__main__':
148+
try:
149+
sys.exit(main())
150+
except Exception as e:
151+
error_handler(e)

0 commit comments

Comments
 (0)