In my application, I am using the global.asax's Application_Error to manage all unhandled exceptions -- essentially, I log the exception and redirect the user to specified error page.
I have introduced a new entry point into my application that requires two parameters. If either of the parameters are not available, I throw a custom exception to specifically identify this new error type. The problem is, I'm not sure how to differentiate in the global.asax between this specific exception [I've defined it as MonthlyBreakdownException]
and all other exceptions. How can I obtain the specific error type [MonthlyBreakdownException
] in my code below?
I'm using Visual Studio 2005, C#
Here is my code that I'm using currently:
Exception ex = Server.GetLastError().GetBaseException();
//I'd like to check for my new error here//
if (Session["sessionId"] == null)
Response.Redirect("LandingPage.aspx?sessionid=" + "none", true);