mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-02 19:29:10 +08:00
https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1934208 changed the behavior for handling errors emitted by CDP. It made `InspectorBackend.js` reject on errors rather than resolving with `null`. However, the majority of existing callsites of the CDP invocations cannot handle promise rejections, which led to bugs such as https://crbug.com/1063012 (logging to the console was broken). This patch reverts back to the original behavior of resolving with `null` until we can design a gradual migration strategy to safely rejecting CDP errors with error messages. This CL also updates EmulationModel to use `invoke_` for CDP commands when error messages are potentially useful. Design doc: https://goo.gle/devtools-cdp-error-handling Bug: chromium:1077892 Change-Id: I54a48571aa51e90d939f98499b4c21785b3a5b72 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2193586 Reviewed-by: Paul Lewis <aerotwist@chromium.org> Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Changhao Han <changhaohan@chromium.org>