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)