playwright/packages/playwright-core/src
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
..
cli chore: split error to client and server sides (#27672) 2023-10-17 21:34:02 -07:00
client fix: do not generate api call steps inside named expects (#28609) 2023-12-13 09:06:02 -08:00
common chore(logs): Add new log level to capture client-server message's metadata information (#28141) 2023-11-15 15:37:14 -08:00
image_tools Fix various typos (Fixes #27396) (#27391) 2023-10-04 19:56:42 -07:00
protocol feat(vrt): allow providing screenshot style (#28229) 2023-11-30 17:42:45 -08:00
remote chore(logs): Add new log level to capture client-server message's metadata information (#28141) 2023-11-15 15:37:14 -08:00
server fix(route): silently catch errors when handling route on server (#28612) 2023-12-13 09:34:20 -08:00
third_party chore: remove experimental dockerfile.remote (#20790) 2023-02-09 12:18:02 -08:00
utils fix: collect all errors in removeFolders (#28239) 2023-11-20 10:58:10 +01:00
androidServerImpl.ts chore: add Playwright to attribution (#23447) 2023-06-01 17:54:43 -07:00
browserServerImpl.ts chore: support await using for close() and dispose() (#27766) 2023-10-24 12:25:53 -07:00
DEPS.list feat(android): add Android.{launchServer,connect} (#18263) 2022-10-24 17:23:11 -07:00
inprocess.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
inProcessFactory.ts chore: mark outofprocess connection not as remote (#28156) 2023-12-06 17:58:19 -08:00
outofprocess.ts chore: mark outofprocess connection not as remote (#28156) 2023-12-06 17:58:19 -08:00
utilsBundle.ts chore: get rid of rimraf package (#27790) 2023-10-26 19:41:00 +02:00
zipBundle.ts chore(har): allow replaying from zip har (#14962) 2022-06-17 16:11:22 -07:00