Improve error handling for GetDelta and GetLongpollDelta