[webkit-dev] Single location for people wanting to learn to use dev tools WAS: Blog post draft: dealing with exceptions using Web Inspector
ojan at chromium.org
Wed Apr 13 14:06:02 PDT 2011
Do we have a single page to point people to for learning to use the
inspector? Would be nice if there were a page that just linked to all the
On Wed, Apr 13, 2011 at 2:02 AM, Yury Semikhatsky <yurys at chromium.org>wrote:
> Including the draft content inline for those who don't have post
> Web Inspector: Understanding Stack Traces<http://www.webkit.org/blog/?p=1544> Posted
> by *Yury Semikhatsky* on Wednesday, April 13th, 2011 at 1:44 am
> when it’s already released is an important part of web development. We’ve
> made some improvements in the tools that allow you to work with stack
> traces. Now it’s a good time to summarize the ways one can deal with
> exceptions and stack traces in WebKit.
> Tracking exceptions
> When something goes wrong, you open the Web Inspector console (Ctrl+Shift+J
> message has a link to the file name with the line number you can navigate
> However, there might be several execution paths that lead to the error and
> it’s not always obvious which one of them has happened. Since recently, once
> Web Inspector window is opened, exceptions in the console are accompanied
> messages to see the stack frames and navigate to the corresponding locations
> in the code:
> thrown and inspect its call stack, scope variables and state of your app. A
> tri-state stop button at the bottom of the Scripts panel enables you to
> switch between different exception handling modes: you can choose to either
> pause on all exception or only on the uncaught ones or you can ignore
> exceptions altogether.
> Printing stack traces
> Printing log messages to the Web Inspector console is also very helpful in
> understanding how your application behaves. Now you can make the log entries
> even more informative by including associated stack traces. There are
> several ways of doing that.
> - You can instrument your code with console.trace() calls that would
> call console.assert() with the error condition as the first parameter.
> Whenever this expression evaluates to false you will see a corresponding
> console record:
> Handling exceptions at runtime using window.onerror
> Recently we’ve added support for setting a handler function to
> context and is not caught by any try/catch block, the function will be
> invoked with the exception’s message, the URL of the file where the
> exception was thrown and the line number in that file passed as three
> arguments in that order. You may find it convenient to set an error handler
> that would collect information about uncaught exceptions and report it back
> to your server.
> Note that for more information on the recent features of the Web Inspector,
> you can visit the Chrome DevTools<http://code.google.com/chrome/devtools/docs/overview.html> documentation
> You can follow any responses to this entry through the RSS 2.0<http://www.webkit.org/blog/?p=1544/feed/> feed.
> Both comments and pings are currently closed. Edit this entry.<http://www.webkit.org/blog/wp-admin/post.php?action=edit&post=1544>
> Comments are closed.
> On Wed, Apr 13, 2011 at 10:35 AM, Yury Semikhatsky <yurys at chromium.org>wrote:
>> Hello everyone,
>> I've prepared a blog post draft(
>> http://www.webkit.org/blog/?p=1544&preview=true) that gives an overview
>> using Web Inspector. Your comments
>> and suggestions are welcome.
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the webkit-dev