Error search an EPiServer Composer function when drag and drop fails

by Fredrik Karlsson 11. November 2009 22:19

One of the most annoying things about EPiServer Composer is its lack of error handling by default. If you have an function that throws an normal .net error message it will not show up as you want it to when you drag and drop a function onto a page. Heres an example.

The Function

This function simply throws an "Divide by zero" error.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Dropit.Extension.Core;

namespace EPiServer.ComposerSampleTemplates.Composer.Functions
{
	public partial class ErrorFunction : BaseContentFunction
	{
		protected void Page_Load(object sender, EventArgs e)
		{
			var i = 0;
			var j = 1/i;			
		}
	}
}

The result

Heres what it will look like in the UI:


and the log file will be empty cause its a normal .net error message.

The tool

This is a simple web form that allows you to see any result generated by EPiServer Composer when trying to load the function. It will display any errors. See image:

The code

You can download it here:

ComposerFunctionsTestPage.rar (821.00 bytes)

Tags: , ,

Development

blog comments powered by Disqus

Creative Commons License
This work is licensed under a Creative Commons Attribution-Share Alike 2.5 Sweden License.


Welcome to the Dropit blog!

Here we, the people that work at Dropit, will write about stuff that interests us. For example web development, especially with .NET and EPiServer - but we'll also talk about other techniques that interest us, marketing on the web, social phenomenons, pop culture, games and software development in general.