playwright/packages/playwright-core/src/server/recorder
Yury Semikhatsky 9d91b7caf5
fix(route): silently catch errors when handling route on server (#28612)
This is a follow-up to 119afdf788 Since
continue/fulfill/abort now may throw on the server after page has been
closed, we need to catch the errors manually. On the client it's fixed
by the original change.

This fixes errors in the existing tests:
```
  1) [chromium] › library/browsercontext-route.spec.ts:172:3 › should support Set-Cookie header ────

    Error: 

       at ../packages/playwright-core/src/server/chromium/crConnection.ts:147

      145 |     const id = this._connection._rawSend(this._sessionId, method, params);
      146 |     return new Promise((resolve, reject) => {
    > 147 |       this._callbacks.set(id, { resolve, reject, error: new ProtocolError('error', method) });
          |                                                         ^
      148 |     });
      149 |   }
      150 |

        at /Users/yurys/playwright/packages/playwright-core/src/server/chromium/crConnection.ts:147:57
        at new Promise (<anonymous>)
        at CRSession.send (/Users/yurys/playwright/packages/playwright-core/src/server/chromium/crConnection.ts:146:12)
        at RouteImpl.continue (/Users/yurys/playwright/packages/playwright-core/src/server/chromium/crNetworkManager.ts:566:25)
        at FrameManager.requestStarted (/Users/yurys/playwright/packages/playwright-core/src/server/frames.ts:299:23)
        at CRNetworkManager._onRequest (/Users/yurys/playwright/packages/playwright-core/src/server/chromium/crNetworkManager.ts:314:57)
        at CRNetworkManager._onRequestPaused (/Users/yurys/playwright/packages/playwright-core/src/server/chromium/crNetworkManager.ts:202:12)
        at CRSession.emit (node:events:517:28)
        at /Users/yurys/playwright/packages/playwright-core/src/server/chromium/crConnection.ts:172:14
        at runNextTicks (node:internal/process/task_queues:60:5)
        at processImmediate (node:internal/timers:447:9)
```


![image](https://github.com/microsoft/playwright/assets/9798949/1c436dc2-f113-4ba6-952c-dca5a8c5fa62)

Reference https://github.com/microsoft/playwright/issues/28490
2023-12-13 09:34:20 -08:00
..
codeGenerator.ts fix(codegen): don't generate page.frame() calls anymore (#27820) 2023-10-30 21:56:45 +01:00
csharp.ts feat(recorder): assert visibility tool (#28142) 2023-11-14 12:55:34 -08:00
DEPS.list fix(ui-mode/tv): do not open new tab on macOS (#26877) 2023-09-06 22:57:29 +02:00
java.ts feat(recorder): assert visibility tool (#28142) 2023-11-14 12:55:34 -08:00
javascript.ts feat(recorder): assert visibility tool (#28142) 2023-11-14 12:55:34 -08:00
jsonl.ts chore(internal): generate code in jsonl (#23124) 2023-05-20 10:15:33 -07:00
language.ts chore: move sever/isomorphic to utils/ to use it in client (#21445) 2023-03-06 18:49:14 -08:00
python.ts feat(recorder): assert visibility tool (#28142) 2023-11-14 12:55:34 -08:00
recorderActions.ts feat(recorder): assert visibility tool (#28142) 2023-11-14 12:55:34 -08:00
recorderApp.ts fix(route): silently catch errors when handling route on server (#28612) 2023-12-13 09:34:20 -08:00
recorderUtils.ts chore: migrate codegen to controller events (#17450) 2022-09-20 14:32:21 -07:00
utils.ts chore: flatten supplements (#13437) 2022-04-08 12:52:40 -07:00