Example #1
0
        /// <summary>
        /// Host app must call this when receiving http request on POST /api/retro/main
        /// </summary>
        public async Task <MainResponse> HandleHttpMain(MainRequest req)
        {
            var resp = new MainResponse();

            try
            {
                var user = ClientPlex.GetUser(req.SessionKey);
                if (user == null)
                {
                    return new MainResponse {
                               ErrorCode = Constants.ERRCODE_BADUSER
                    }
                }
                ;
                await HandleHttpMain(req, user, resp);
            }
            catch (Exception ex)
            {
                resp.ErrorCode = Constants.ERRCODE_INTERNAL;
                Diagnostics.ReportClientCallError?.Invoke(ex.ToString());
            }
            return(resp);
        }