• Simon Zünd's avatar
    [inspector] Add Runtime#getExceptionDetails CDP method · 1f53cbf1
    Simon Zünd authored
    CDP has a "ExceptionDetails" structure that is attached to various
    CDP commands, e.g. "Runtime#exceptionThrown" or "Runtime#evaluate".
    The stack trace in the "ExceptionDetails" structure is used in
    various places in DevTools. The information in the "ExceptionDetails"
    structure is extracted from a v8::Message object. Message objects
    are normally created at the exception throw site and may augment
    the error with manually inspecting the stack (both to capture a fresh
    stack trace in some cases, as well as to calculate location info).
    
    The problem is that in some cases we want to get an "ExceptionDetails"
    structure after the fact, e.g. when logging a JS "Error" object in
    a catch block. To help in this case, this CL introduces a new
    CDP method "Runtime#getExceptionDetails" that behaves exactly as
    advertised: It provides a populated "ExceptionDetails" structure
    from a JS Error object.
    
    R=bmeurer@chromium.org
    
    Doc: https://bit.ly/runtime-get-exception-details
    Bug: chromium:1278650
    Change-Id: I084be10c1d852d3b7cac8d88e7f820e867be4722
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3337258
    Commit-Queue: Simon Zünd <szuend@chromium.org>
    Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
    Cr-Commit-Position: refs/heads/main@{#78676}
    1f53cbf1
get-exception-details.js 1.34 KB