Skip to content
Browse files

Merge pull request #561 from aaronlerch/master

Improve Razor diagnostic experience when not using a debugger
  • Loading branch information...
2 parents 25dd81d + 7c1d97e commit b3b6a98166cba644446d20f20ceaa4f6f199f711 @mythz mythz committed Apr 2, 2013
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/ServiceStack.Razor/ViewPageRef.cs
View
9 src/ServiceStack.Razor/ViewPageRef.cs
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
+using System.Text;
using System.Threading;
using ServiceStack.Text;
using ServiceStack.Logging;
@@ -91,6 +92,14 @@ public void Compile(bool force=false)
Service.Compile(this, this.Contents, PageName);
Log.InfoFormat("Compiled {0} in {1}ms", this.FilePath, sw.ElapsedMilliseconds);
}
+ catch (TemplateCompilationException tcex)
+ {
+ var errors = new StringBuilder();
+ foreach (var error in tcex.Errors)
+ errors.AppendLine(" -- {0}".Fmt(error));
+ Log.Error("Error compiling {0} with errors:{1}{2}".Fmt(this.FilePath, Environment.NewLine, errors), tcex);
+ throw;
+ }
catch (Exception ex)
{
Log.Error("Error compiling {0}".Fmt(this.FilePath), ex);

0 comments on commit b3b6a98

Please sign in to comment.
Something went wrong with that request. Please try again.