New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 674846 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Dec 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug



Sign in to add a comment

FR: Global error catcher for specific methods?

Reported by moni...@gmail.com, Dec 16 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.98 Safari/537.36

Steps to reproduce the problem:
I have an app written in Angular 2 (with heavy usage of Observables), that is spitting out errors like "Cannot read property 'map' of null". The error stack is useless as it points to internal angular code and says nothing about the origin of the error.

In my app code there's like 150 ocurrences of `.map`. This would be the last thing I would like to do - to go and inspect each and every of them.

What is the expected behavior?

What went wrong?
So I was wondering if we could have something like a global listener per invoked 'method' that could allow me - in this particular case - to pin down which of the arrays exactly is null and causing the problem, in which js/ts file (using sourceMap if provided)

Did this work before? N/A 

Chrome version: 54.0.2840.98  Channel: n/a
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 24.0 r0

Let's put aside discussion about using try/catches and defensive programming in one's code. Sometimes you just have to debug what you have on your table :)
 
Do you know about the Blackbox feature? This allows you to ignore specific third-party code so your calls stacks are more manageable while debugging. https://developers.google.com/web/tools/chrome-devtools/javascript/step-code#blackbox_third-party_code

If you combine this with "Pause on Exceptions" for debugging, then you should be able to inspect which arrays are null and why.

Please take a look and let me know if this solves your use case.

Comment 2 by moni...@gmail.com, Dec 16 2016

Well, first off, thank you for a thoughtful reply. Blackboxing should definitely make my console cleaner, I will try the Pausing on Monday.
Cc: chenwilliam@chromium.org
Status: WontFix (was: Unconfirmed)

Sign in to add a comment