Exemple #1
0
        public async Task <HttpResponseMessage> GetChatBackup([FromUri] string sender)
        {
            try
            {
                NeeoUser neeoUser           = new NeeoUser(sender);
                var      operationCompleted = await System.Threading.Tasks.Task.Run(() => neeoUser.GetXMLChatBackup(sender));

                return(Request.CreateResponse(HttpStatusCode.OK, operationCompleted));
            }
            catch (ApplicationException applicationException)
            {
                return(Request.CreateErrorResponse((HttpStatusCode)Convert.ToInt16(applicationException.Message), NeeoDictionaries.HttpStatusCodeDescriptionMapper[Convert.ToInt16(applicationException.Message)]));
            }
            catch (Exception exception)
            {
                Logger.LogManager.CurrentInstance.ErrorLogger.LogError(System.Reflection.MethodBase.GetCurrentMethod().GetType(), exception.Message, exception);
                return(Request.CreateResponse(HttpStatusCode.InternalServerError));
            }
        }