Error tracking in angular

Hi @Sonukapoor,

The $exceptionHandler catch Angular exceptions (missing controleur for example).
For JS exceptions, you need to add a window.onerror function (cf the second par of my initial post)

Hi, Not sure what you mean with its missing the controleur?

I understand what you mean. Let me make some changes to the code. Thanks for sharing your code. Its very appreciated.

You’re welcome :wink:
I’m happy if it helps people.

1 Like

@Ioicknuchel how did you define that track function for sending exception to server

@vinaygarg502 I do some complicated & custom things… You can see my code here : https://github.com/saloonapp/saloon-app/blob/v1/www/js/config/_log.js

Basically, my track() function save errors in localStorage and then sync them with backend…
This is quite custom… Maybe you want to use SaaS services like https://getsentry.com/

Thakyou … thats what i was looking for :slight_smile:

@loicknuchel hey thank you for sharing your code :slight_smile:. Can you please tell how can I use this function to throw exception manually and pass on some other information as well. Like I already have a catch or error function linked with some http call or some other function and I want to throw the exception manually from inside the function so that I may pass some custom data as well. And later sync the error report with my server just as you did with track() function.