If you've spent any amount of time developing in AngularJs, you've probably run into the "stack trace of doom" which looks something like this:
angular error

While these stack traces can't be entirely avoided, you can do you and your fellow developers a favor and not create these anymore (at least on purpose). Since error handling in Javascript is a touchy subject subject at best, many developers choose not throw using the Error object and merely use throw 'This is an error' to create an error state for their app. Throwing errors this way is a bad idea and a good way to end up with the "stack trace of doom" as AngularJs will catch the error on the next digest cycle and give you its internal stack trace.

The correct way to throw an error is to use the Javascript Error object constructed via throw new Error('This is an Error'). Using the Error object will not only give you the line number, it will give you a neat stack trace of the error and make your debugging easier.