[#2450] Initialize Sentry service at application start #2470
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The purpose of this change is to optimize the initialization of the Sentry service in the application. Previously, the Sentry service was initialized whenever an exception occurred, which could lead to resource inefficiencies and potential performance bottlenecks. By shifting the initialization to the start of the app lifecycle, rather than initializing repeatedly during exceptions, the application ensures that the Sentry service is consistently ready to handle exceptions right from the start and throughout the entire operation of the application. This adjustment aims to align with the user story's goal of improving exception handling efficiency through centralized initialization.
The outcome of this change is an improvement in the application's performance and resource management. By initializing the Sentry service just once at the start, the application reduces unnecessary repetitive initializations, which can consume system resources and slow down operations. The update also ensures that the Sentry service is seamlessly integrated and ready for use whenever an exception needs to be handled, enhancing the overall robustness and reliability of the application's error management processes.