c# - how to see original error thrown in asp.net application -


i have asp.net 2.0 web application in webserver deployed. 1 of function have code below:-

...

try { //some system/.net exception occurred } catch (exception ex) { //show custom message } 

...

as can see system/.net exception caught in catch block actual exception not displayed or logged anywhere. how can see actual error occurred in webserver without modifying code?

the problem don't have source code , don't want decompile dlls , re-deploy dlls after recreating code.

also, nothing getting logged in event log.

is there way or tool find out error has occurred in try...catch block see actual error message?

the commenter correct. cannot intercept exception if it's being suppressed.

however, if it's propagating call stack, can add new ihttpmodule , log exception so:

public class thelogger : ihttpmodule {     httpapplication _ctx;      public void dispose()     {      }      public void init(httpapplication context)     {         _ctx = context;         _ctx.error += _ctx_error;     }      void _ctx_error(object sender, eventargs e)     {         var ex = _ctx.server.getlasterror();         file.appendalltext("c:\\log.txt", ex.tostring());     } } 

adding reference logged web.config:-

  <system.webserver>     <modules>       <add name="exceptionlogger" type="exceptionlogger.thelogger, exceptionlogger"/>     </modules>   </system.webserver> 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -