How can we register exception filter globally in web api?
Loading
How can we register exception filter globally in web api?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satish RathorePosted Sep 27, 2022, 1:03 PM
In WebApiConfig under Register method Add config.filers.add(new 'yourfiltername')
Uday DodiyaPosted Sep 27, 2022, 11:27 AM
Hi Naresh,
Refer Following
https://www.c-sharpcorner.com/article/implement-global-exception-handling-in-asp-net-core-application/
Vishal YelvePosted Sep 27, 2022, 5:14 AM
Hi Naresh,
Please refer to below link
https://stackify.com/how-to-handle-global-exception-handler-with-c-web-api/
https://code-maze.com/global-error-handling-aspnetcore/
https://www.c-sharpcorner.com/article/global-exception-filter-exception-handling-and-logging-using-log4net-in-web-api/
Amit MohantyPosted Sep 27, 2022, 4:44 AM
Check the below articles, this may clear your doubt.
https://www.c-sharpcorner.com/article/global-exception-filter-exception-handling-and-logging-using-log4net-in-web-api/
https://www.c-sharpcorner.com/article/exception-handling-in-asp-net-web-api/