Description
We need to implement a try/catch decorator for all functions in the TelemetryClient class to ensure robust error handling and prevent any telemetry-related issues from affecting the main application flow.
Current Behavior:
Some functions in the TelemetryClient class have basic error handling, for example, the initialize() method silently catches all exceptions.
However, other methods may throw uncaught exceptions that could impact the application
Proposed Changes:
Create a decorator that will:
- Catch all exceptions
- Log errors appropriately
- Prevent exceptions from propagating to calling code
- Maintain the telemetry client's non-blocking nature
Functions requiring the decorator:
set_opt_out()
initialize()
_get_prefixed_endpoint()
_get_telemetry_identifier()
_start_threads()
_get_system_metadata()
_exit_cleanly()
_send_request()
Description
We need to implement a try/catch decorator for all functions in the TelemetryClient class to ensure robust error handling and prevent any telemetry-related issues from affecting the main application flow.
Current Behavior:
Some functions in the TelemetryClient class have basic error handling, for example, the
initialize()method silently catches all exceptions.However, other methods may throw uncaught exceptions that could impact the application
Proposed Changes:
Create a decorator that will:
Functions requiring the decorator:
set_opt_out()initialize()_get_prefixed_endpoint()_get_telemetry_identifier()_start_threads()_get_system_metadata()_exit_cleanly()_send_request()