Quantcast
Channel: Using Optimizely Platforms
Viewing all articles
Browse latest Browse all 8020

Triggering Alloy's ErrorHandlingContentRenderer

$
0
0

Hello,

I was reviewing Alloy's error handling features and was trying to trigger the "nice" error alert, the partial view TemplateError.cshtml, that should be rendered in the body amongst other blocks instead of a server error (YSOD) when an exception is encountered rendering a block. However, I could not actually get this view to show up when forcing a few exceptions here and there, and I need some help.

I first started with a "block killer" by throwing an exception in the Jumbotron model on a property's get method. I then tried to throw an exception in the ContactBlock controller while it's creating its new ViewModel. My poison of choice was NullReferenceException which I confirmed is listed in ErrorHandlingContentRenderer. I would have expected either of these "block level" exceptions to have been caught and the TemplateError alert shown.

Maybe I'm just too tired and I'm throwing these wrong somehow, lol?, or I don't really follow how this particular error handling feature is supposed to work. Could you please let me know if I'm just looking at it the wrong way, are you able to trigger the error and if so can you show me how?

Thanks for any help :)


Viewing all articles
Browse latest Browse all 8020

Trending Articles