ASP.NET - Filter a particular exception from overall exception message

Asked By anbu n on 21-Jan-14 10:48 PM
i get soap exception , in which there is system.net.webexception
request uRI is too long 400 error .

i need to filter this error alone from overall exception message to show it in aspx page to end user
Robbe Morris replied to anbu n on 22-Jan-14 08:10 AM
From a security perspective, you really don't want to do this.  Log the message, stacktrace and if the InnerException is not null, grab the properties off of it and stick it in a log file and/or email it to an administrator.

No matter whether your site is an intranet or internet site, security recommendations strongly suggest NOT display information like this to the end user.