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

Issue 610559 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Feature



Sign in to add a comment

logging a caught error should be the same as "throw new Error()"

Project Member Reported by dstockwell@chromium.org, May 10 2016

Issue description

eg.

try {
  throw new Error();
} catch (e) {
  console.log(e);
}

Prints the error object but the references to the source code can't be clicked.
 
Labels: -OS-Chrome OS-All

Comment 2 by caseq@chromium.org, May 10 2016

Labels: Needs-Feedback
Don't we do that? It works for me on the tip of tree. Can you please provide more details on the scenario?

Comment 3 by l...@chromium.org, May 10 2016

I'm not the reporter, but it seems to me like console.logging an error that isn't thrown doesn't reveal any links when clicked.

Are those links part of the error itself?
s1.png
51.1 KB View Download
Owner: kozyatinskiy@chromium.org
Status: Assigned (was: Untriaged)
This is working as expected - you log arbitrary object in the first case and throw in the second. But we could try improving it and custom-format error objects.
As workaround: you can use console.error instead console.log.
Labels: -Needs-Feedback
Project Member

Comment 7 by bugdroid1@chromium.org, Aug 30 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/cdcbb06b51d195d106b4a217a6fa411fd8b54a66

commit cdcbb06b51d195d106b4a217a6fa411fd8b54a66
Author: kozyatinskiy <kozyatinskiy@chromium.org>
Date: Tue Aug 30 05:17:35 2016

[DevTools] Format console.log(new Error()) same as console.log(new Error().stack)

Then DevTools will linkify links from error.stack.

BUG= 610559 
R=lushnikov@chromium.org

Review-Url: https://codereview.chromium.org/2284123002
Cr-Commit-Position: refs/heads/master@{#415145}

[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-exception-source-url-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-promise-reject-and-handle-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/http/tests/inspector-enabled/console-stack-overflow-source-url-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/http/tests/inspector/console-test.js
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector-enabled/console/console-uncaught-promise-no-inspector-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-eval-object-literal-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-eval-throw-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-eval-undefined-override-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-format-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-log-eval-syntax-error-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-log-linkify-stack-in-errors-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-log-linkify-stack-in-errors.html
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-message-from-inline-with-url-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-save-to-temp-var-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-stack-overflow-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-exception-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-exception-in-eval-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-uncaught-promise-in-worker-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-worker-nested-imports-syntax-error-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/console-xpath-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/exception-objects-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/console/function-name-in-console-message-stack-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger-async/async-callstack-in-console-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-on-call-frame-inside-iframe-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-while-paused-throws-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger-pause/debugger-eval-while-paused-throws.html
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger-ui/debugger-save-to-temp-var-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger/debugger-uncaught-promise-on-pause-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/LayoutTests/inspector/sources/debugger/rethrow-error-from-bindings-crash-expected.txt
[modify] https://crrev.com/cdcbb06b51d195d106b4a217a6fa411fd8b54a66/third_party/WebKit/Source/devtools/front_end/console/ConsoleViewMessage.js

Status: Fixed (was: Assigned)

Sign in to add a comment