Exemplo n.º 1
0
 /// <summary>
 /// Renders the contentData using the wrapped renderer and catches common, non-critical exceptions.
 /// </summary>
 public void Render(HtmlHelper helper, PartialRequest partialRequestHandler, IContentData contentData, TemplateModel templateModel)
 {
     try
     {
         _mvcRenderer.Render(helper, partialRequestHandler, contentData, templateModel);
     }
     catch (Exception) when(HttpContext.Current.IsDebuggingEnabled)
     {
         //If debug="true" we assume a developer is making the request
         throw;
     }
     catch (NullReferenceException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (ArgumentException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (ApplicationException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (InvalidOperationException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (NotImplementedException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (IOException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (EPiServerException ex)
     {
         HandlerError(helper, contentData, ex);
     }
     catch (XFormException ex)
     {
         HandlerError(helper, contentData, ex);
     }
 }
Exemplo n.º 2
0
 public void Render(HtmlHelper helper, PartialRequest partialRequestHandler, IContentData contentData, TemplateModel templateModel)
 {
     try
     {
         _mvcRenderer.Render(helper, partialRequestHandler, contentData, templateModel);
     }
     catch (NullReferenceException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
     catch (ArgumentException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
     catch (ApplicationException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
     catch (InvalidOperationException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
     catch (NotImplementedException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
     catch (IOException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
     catch (EPiServerException ex)
     {
         if (HttpContext.Current.IsDebuggingEnabled)
         {
             throw;
         }
         HandlerError(helper, contentData, ex);
     }
 }