c# - Global exception handler in Web API not getting called -


similar question asked here issue concerning 404 error.

i have added elmah global handler described here. if raise error in code elmah catches fine, if have sql error ef via controller example, not caught - exception message returned in json 500 error.

according article there few cases exception can't caught case doesn't seem 1 of them.

can please explain why global error handler in webapi won't catch sql exception?

here's handler:

public class unhandledexceptionfilter : exceptionfilterattribute {     public override void onexception(httpactionexecutedcontext context)     {         elmah.errorlog.getdefault(httpcontext.current).log(new elmah.error(context.exception));     } } 

and here's it's registered in webapiconfig.cs

public static void register(httpconfiguration config) {     ----     config.filters.add(new unhandledexceptionfilter()); } 


Comments

Popular posts from this blog

javascript - oscilloscope of speaker input stops rendering after a few seconds -

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -