views:

26

answers:

1

My Setup:

Asp.Net MVC 2, SparkViewEngine w/ WebFormsViewEngine

Problem:

I have the following spark view:

<content name="title">
       Home Page
</content>
<h2>Home Page</h2>
<p>
    lalalalalalalalalalala.
</p>
#throw new NotImplementedException();

When this page loads I get a YSOD instead of my default shared Error view. Views that use the WebFormsViewEngine redirect correctly if an exception happens. What could I be missing here?

A: 

Spark is not designed to handle exceptions. I would question why you have an exception being thrown in your view. Either you're in debug/development mode, in which case you want to see the exceptions, or you're in release mode, in which case you should have a sufficiently tested system that isn't throwing exceptions in your view. Anything that could possibly cause an exception should be done in the controller.

Spark WILL handle NullReferenceException, but in that case it only writes the code that caused it to the output.

dave thieben
Do you know if there is a way to override/replace the default spark error page then?
Jared