Esempio n. 1
0
 private async Task TryCatch(Func <Task> action)
 {
     try
     {
         await action();
     }
     catch (Exception ex)
     {
         _siteController.WriteExceptionStatus(ex, Response);
     }
 }
Esempio n. 2
0
 public Task TryCatch(Func <Task> action)
 {
     try
     {
         return(action());
     }
     catch (Exception ex)
     {
         _siteController.WriteExceptionStatus(ex, Response);
     }
     return(null);
 }
Esempio n. 3
0
        public async Task <ActionResult> Default(String pathInfo)
        {
            try
            {
                if (await _siteController.ProcessRequest(pathInfo, Request, Response))
                {
                    return(null);
                }

                var viewInfo = await _siteController.LoadView(pathInfo);

                return(View(viewInfo.View, viewInfo));
            }

            catch (Exception ex)
            {
                _siteController.WriteExceptionStatus(ex, Response);
            }
            return(null);
        }