Hello,
for error handling I have a few lines of code for catching every error in the global.asax
: void Application_Error(object sender, EventArgs e)
the content of the function looks like this:
try
{
Exception objErr = Server.GetLastError().GetBaseException();
if (!(objErr is HttpException))
{
shop.BLL.Utility.Errorlog.WriteError(objErr, "Global.asax caught an Exception");
}
else
{
HttpException hex = (HttpException)objErr;
if (hex.ErrorCode == 404)
Response.Redirect("404.aspx?msg=" + hex.Message);
else
{
shop.BLL.Utility.Errorlog.WriteError(hex, "Global.asax caught an HttpException code: " + hex.ErrorCode);
}
}
}
catch { }
Server.ClearError();
now here is the thing: when I go to blabla.aspx
, which does not exists, it ends up on line shop.BLL.Utility.Errorlog.WriteError(hex, "Global.asax caught an HttpException code: " + hex.ErrorCode);
and the value of the errorcode is -2147467259
why isn't it a 404?
Thanks in advanced for your time and effort!
best regards, JP