How can we register exception filter globally in web api?
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit MohantyRank #112 · 20K reputationPosted Sep 27, 2022, 12:44 AM EDT
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/
Vishal YelveRank #178 · 13.6K reputationPosted Sep 27, 2022, 1:14 AM EDT
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/
Uday DodiyaRank #239 · 10.3K reputationPosted Sep 27, 2022, 7:27 AM EDT
Hi Naresh,
Refer Following
https://www.c-sharpcorner.com/article/implement-global-exception-handling-in-asp-net-core-application/
Satish Rathore122 reputationPosted Sep 27, 2022, 9:03 AM EDT
In WebApiConfig under Register method Add config.filers.add(new 'yourfiltername')