In the Application_Error event, I get the last error via:
Exception lastError = Context.Server.GetLastError();
which always yields the same error: Exception of type 'System.Web.HttpUnhandledException' was thrown.
How do I get to the actual error that occurred?
Also read this complete refernece: How to create custom error reporting pages in ASP.NET by using Visual C# .NET