--
You received this message because you are subscribed to the Google Groups "bidi-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+u...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/bidi-dev/4aa66980-a508-4ff9-b99c-2db7731a486an%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
Could you give some more details, and perhaps an example of each? What are the pros/cons of each approach? It might be easier to review a small design doc.On Fri, Sep 24, 2021 at 4:10 PM Maksim Sadym <sa...@chromium.org> wrote:Hi all!
I started implementing `script.evaluate`, and figured out there will be no way to get a stacktrace if we evaluate script and serialise the results in the page context. In case of enabled `Debugger` domain in CDP, the stacktrace, col and raw will be there CDP result, but there is no way to get a stacktrace of a caught exception from a script itself.I can see 2 ways:
1. (worse) make `stacktrace, col and raw` optional and don't provide it at all.
2. (better) serialise based on the CDP data in the BiDi mapper context.
3. (hybrid) evaluate script using CDP, and after wards serialise results in the page context.
WDYT?
--
You received this message because you are subscribed to the Google Groups "bidi-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+unsubscribe@chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+u...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/bidi-dev/4aa66980-a508-4ff9-b99c-2db7731a486an%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
--
You received this message because you are subscribed to the Google Groups "bidi-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+u...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/bidi-dev/cb8794ef-c76c-4960-9816-86ec2c315accn%40chromium.org.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+unsubscribe@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/bidi-dev/4aa66980-a508-4ff9-b99c-2db7731a486an%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
--
You received this message because you are subscribed to the Google Groups "bidi-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+unsubscribe@chromium.org.
Thanks Philip for your suggestion!
I considered catching not only Errors, but rather anything was thrown.
Do you think we can provide stacktrace in case of having only `Error` thrown?
Talking about wrapping anything thrown into error, the experiment shows the stacktrace is dropped to the point of the catch. Meaning it'll be always only the stacktrace to the point of the serialisation script:```const throwException = ()=>{throw {a:'a'};}const callDelegateAndWrapException = (delegate) => {try{delegate();} catch(e) {return {originalException: e,stack: new Error(e).stack}}}callDelegateAndWrapException(throwException)```Output stacktrace:```Error: [object Object]at callDelegateAndWrapException (<anonymous>:10:16)at <anonymous>:14:3```> How does CDP get the stacktrace when the thrown value isn't an Error, and is that something that content script could do too with some magic bindings injected?It's a `Debugger` domain enriches exceptions with stacktraces in case of any throw.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+u...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/bidi-dev/4aa66980-a508-4ff9-b99c-2db7731a486an%40chromium.org.
For more options, visit https://groups.google.com/a/chromium.org/d/optout.
--
You received this message because you are subscribed to the Google Groups "bidi-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bidi-dev+u...@chromium.org.