Understand the implementation of .NET Framework Web API Global and Custom Exception filter to show Custom Exception Error messages whenever any exception occurs during execution of Web API Action method
Exception Handling in .NET Core Web API using UseDeveloperExceptionPage & UseExceptionHandler methods in Startup.cs class and showing Exception message wherever Web API exception occurs
Getting blocked by CORS policy error even if added in the ASP.NET Web API project, then possibility is that you have missed the required code to be added above controller as well as action method level
Getting error as Message-The-requested-resource-does-not-support-http-method-GET when running ASP.NET Web API from browser or calling from another App, to fix this issue please go through this article
When calling ASP.NET OR .NET Core Web API from Angular or any other application and getting Access to XMLHttpRequest from origin has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource error, then you can visit the article to fix this issue
Enable CORS for .NET Core Web API to allow access to APIs from any hosts, refer the article to Add and Use CORS in .NET Core Web API to allow access to any or specific domain