Clean up error logging in task handler