Category Archives for Elmah

How to capture your client-side errors using Elmah

For those of you who have never heard of Elmah before (where have you been!) it is a powerful and simple way to log errors on your website – go use it, you’ll love it! What I hadn’t considered before was that it could also log client side javascript errors . I picked up this tip from @craigshoemaker on his plurasight course called HTML5 Line of Business Apps with Bootstrap, MVC4 and Web API.

The basic idea is to hook into the ‘window.onerror’ javascript event and to call a dedicated server side endpoint who’s responsible for logging the event in elmah.Continue reading