Better session error handling