Dev.Opera - Follow the standards, break the rulesDev.Opera - Follow the standards, break the rules

Login

Lost password?

Forums » Opera Dragonfly Discussions

Discuss Opera Dragonfly, Opera's new developer tools.

Note: You need to login to post in the forums. if you don't have an account you first need to sign up.

By porneL anchor Wednesday, 7. May 2008, 14:28:24

avatar

JavaScript errors are still unhelpful, console still useless

I've just tried Dragonfly and I'm very disappointed that nothing has been done about vague script error messages.

This is a problem I've been complaining about for a long time.

The console in Dragonfly repeats all the dealbreaking mistakes of Opera's last console:

  • it's a complete mess with all messages from all sites, all parts of opera mixed together.
    • I need windows separated and preferably sites too (so broken ad scripts, google's hacky maps, etc. don't pollute information about my scripts).
    • I need console cleared on reload. I have a hole in my head from scratching it when looking for errors that I've already fixed.
  • formatting doesn't highlight actual problem and just adds noise.
    • The most prominent text of every message is "ecmascript". I know I'm writing ecmascript! I want to know why my ecmascript breaks!
    • Messages have "information" like:
    Error:
    name: Error

    It's meaningless! Why spam console with this nonsense?
  • backtrace is usually very short, brief, stripped. There's no backtrace for exceptions.
    edit I've noticed that debugger supports backtrace nicely, but the console isn't taking advantage of it.
  • location of error is usually inaccurate, like: "Inline script thread" or "line x of script#1" (where x is relative to script tag not document, so I can't jump in editor to that line and have to count lines myself... :/)
  • it's huuuuge and can't be embedded in a panel. Unusable without second monitor.



I hope you guys are keeping some brand new spanking Firebug-like error console for beta 2 :smile:

By fearphage anchor Wednesday, 7. May 2008, 15:15:05

avatar

Originally posted by porneL:

I need console cleared on reload
I don't understand this one. I only want the console cleared when i press the clear button. Auto-clearing could be setting but I would not like it to be the only way.

I agree with most of the other things. I have filed lots of bugs against the error console and/or js engine about the error messages being malformed and uninformative. Most of this is copied from this thread which is still valuable as it contains many other error console and js engine bugs.

filtering doesn't apply to future events [bug #283593]
line numbers reported for inline scripts are relative to the script element (not the document) [bug #278053]

The Improvements:
  1. Filtering is not granular enough
  2. name not identified in userjs scripts
  3. lower browser.js to INFO level
  4. lower blocked scripts to INFO level
  5. can't debug with any level other than ERROR (opera.postError)

Details:
  1. Filtering should be handled in a checkbox-styled way. So I can filter the console to only show javascript, xml, and svg errors for instance. Speaking of which: have any of you ever produced errors in the following categories?: java, xml, html, xslt, svg, link, or internal . just curious. I only see css, js, and once i saw a network error.
  2. Errors in userjs files are not identified by name. If normal javascript files are id'd by name, it seems logical that opera could id userjs by name. This leads to my next point...
  3. Browser.js messages should be lowered to INFO or WARNING level so they can be ignored. I personally think info is the best level because its nothing serious that I should really be warned about.
  4. My error console gets polluted with messages essentially saying "Blocked content is working".
    JavaScript - http://ad.doubleclick.net/adj/ytwatch.comedy/default;sz=728x90;!c=;kvid=5EqGAaLsCP4;kpu=oceanminded222;kgender=m;ko=u;kpid=;kr=A;kage=25;u=5EqGAaLsCP4|;tile=1;dcopt=ist;ord=3362632303033025?
    
    Linked script not loaded
    JavaScript - http://pagead2.googlesyndication.com/pagead/show_ads.js
    
    Linked script not loaded
    Opera should check if the url matches anything from the blocked content list so it can lower the level of blocked content to INFO level
  5. There is no way to debug to any other level than ERROR. Maybe opera could supply opera.postInfo and opera.postWarning. The levels are almost irrelevant because everything is an error in the js section.

    Two other popular requests are to make the error console searchable and dockable/panel-able.
    -------
    Still from that thread:
    #292638 - Regression: Stack trace missing from WRONG_THIS_ERR - link (not test case)
    JavaScript - http://www.usatoday.com/
    Inline script thread
    Error:
    name: Error
    message: WRONG_THIS_ERR
    

    From 9.24:
    JavaScript - http://www.usatoday.com/
    Inline script thread
    Error:
    Unhandled exception: [Object InternalException]
    code: 7
    message: WRONG_THIS_ERR
    Backtrace:
      Line 5 of linked script http://js.usatoday.com/asp/uas/flookie.js
        w("<div style=\"display:none\">");


    #292645 - Regression: Error Console - Useless stack traces
    JavaScript - http://news.softpedia.com/news/How-to-Install-Zimbra-on-Ubuntu-Edgy-49375.shtml
    Timeout thread: delay 100 ms
    Error:
    name: TypeError
    message: The Object does not implement [[Call]]
    Backtrace:
      ...
    


    #295513: Error Console: TypeErrors lack useful details (test case)
    Opera:
    JavaScript - data:text/html,<script>alert(document.foo.bar)</script>
    Inline script thread
    Error:
    name: TypeError
    message: Statement on line 1: Cannot convert undefined or null to Object
    Backtrace:
      Line 1 of inline#1 script in data:text/html,<script>alert(document.foo.bar)</script>
        alert(document.foo.bar)

    Firefox:
    document.foo has no properties


    #295482 - Security violations provide virtually no useful information
    JavaScript - http://ba.embeddedstorage.techweb.com/
    Inline script thread
    Error:
    name: ReferenceError
    message: Security error: attempted to read protected variable
    
    ---
    
    JavaScript - http://files.myopera.com/d.i.z./bugs/Domain_Issue.html
    Javascript URL thread: "javascript:operaDevConsole()"
    Error:
    name: Error
    message: Security violation


    #295663: Regression: Error Console - Position is restored instead of just becoming active
    Steps to reproduce:
      1. Open error console
      2. Move it from its default location
      3. Open the error console again
    
    Expected results:
      It is brought to the foreground in the new position I moved it to.
    
    Actual Results:
      It is restored to its original position and brought to the foreground.

Post edited Wednesday, 7. May 2008, 15:22:02

By porneL anchor Wednesday, 7. May 2008, 15:51:38

avatar
I don't understand this one. I only want the console cleared when i press the clear button. Auto-clearing could be setting but I would not like it to be the only way.

My workflow is like this:
  1. I see an error in the console
  2. I go and fix the error
  3. I reload the page
  4. I still see the error in the console

At this point I always have to pause and think am I looking at up-to-date error? Did it happen again or did I forget to clear the console before reloading?

By fearphage anchor Wednesday, 7. May 2008, 16:03:36

avatar

Originally posted by porneL:

Did it happen again or did I forget to clear the console before reloading?
You could alternatively collapse the individual error or all previous errors. I have the same workflow like most people but i can more easily recognize when and if bugs are fixed I guess. I use opera.postError a lot. generally something like:
opera.postError('before: broken area');
/*
  some code thats probably gonna break
*/
opera.postError('after: broken area');
Just alternate suggestions. The problem with your suggestion is that Opera uses one console that encompasses all tabs. So when you clear on reload of any tab you lose data from all of them. Imagine you have a tab on autoreload and it reloads right as you are trying to read the error console... now everything is gone. That would be annoying and a hassle. I would still like to see you get your wish but it should definitely be configurable in my opinion.

By porneL anchor Wednesday, 7. May 2008, 19:31:32

avatarYes, collapsing of old errors is even better idea!

By FataL anchor Thursday, 8. May 2008, 18:47:09

avatar

Originally posted by porneL:

Yes, collapsing of old errors is even better idea!
:yes:

By Schalandra anchor Friday, 9. May 2008, 06:32:35

avatarSigned. :up:

Moderators: dstorey | operadev | chrismills