Aaryan26 0 Newbie Poster

Hi all,
I am trying to generate error msg using custom error handling module. I create a separate project and add the following code

public class FriendlyErrorModule:IHttpModule
{
public void Init(HttpApplication app)
{
app.Error += new EventHandler(app_Error);
}

void app_Error(object sender, EventArgs e)
{
HttpApplication ap = (HttpApplication)sender;
HttpContext con = ap.Context;
Exception ex = (Exception)con.Server.GetLastError().GetBaseException();
con.Server.ClearError();
CompilationSection comsec = (CompilationSection)WebConfigurationManager.GetWebApplicationSection("system.web");
if (comsec.Debug)
{
con.Server.Transfer("Friendly_Default.aspx");
}
else
{
con.Server.Transfer("Friendly_public.aspx");
}


}
public void Dispose()
{
}

in the main project, i add a reference to the dll and included the module name in the web.config file.when I purposefully generated a divide by zero exception and execute it, i get the following error msg
XML Parsing Error: no element found
Location: home.aspx
Line Number 1, Column 1:

could anybody tell me where I have gone wrong?