Handle exceptions in background service