title: Send Angular (6) client side errors to web API for logging
body: <p>Another person asked my exact question here with no answer: <a href="https://stackoverflow.com/questions/43530156/angular-2-client-side-errors">Angular 2 Client Side Errors</a></p>
  
  <p>I'm wanting a way (avoiding additional third party frameworks if possible) to send my client-side Angular errors to my back end exception logger.</p>
  
  <p>My back end is just a <code>.NET Web API</code> project that's connected to our <code>SQL Server</code> database. My server side errors are currently being logged to the database by calling a stored procedure controller whenever a server error occurs (I used KudVenKat's tutorial to build this: <a href="http://csharp-video-tutorials.blogspot.com/2012/12/logging-exception-to-database-part-75.html" rel="nofollow noreferrer">http://csharp-video-tutorials.blogspot.com/2012/12/logging-exception-to-database-part-75.html</a>).</p>
  
  <p>Is there a way to write an Angular service which calls my ErrorLogger API to log my Angular errors to the database?</p>
  
  <p>I figure I may have to tweak my back end logger controller since it's using .NET's <code>System.Exception</code> class, which I'm guessing is only good for detecting server side exceptions, not Angular's. I may need an entirely different logger controller and database table for client side errors only - but I'd like server and client side errors logged to the same table if possible.</p>
  
  <p>Knowing this - is what I'm trying to do even a good approach? If not, can anyone give me a high level description of how I might go about logging these client side errors instead? </p>