Use $exceptionHandler to handle exceptions globally. Override this service to capture and log errors, providing centralized error management.
$exceptionHandler