playwright/packages/playwright-core
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
..
bin fix: Google Chrome Beta/Stable install on macOS (#27880) 2023-10-31 16:49:13 +01:00
bundles chore: get rid of rimraf package (#27790) 2023-10-26 19:41:00 +02:00
src fix(route): silently catch errors when handling route on server (#28612) 2023-12-13 09:34:20 -08:00
types chore: use ReadonlyArray for input parameters (#28564) 2023-12-12 16:22:48 -08:00
.eslintrc.js lint: prevent object string concatenation (#23172) 2023-05-19 15:17:43 -07:00
.npmignore chore: fix installation tests (#26602) 2023-08-22 16:48:52 +02:00
browsers.json feat(chromium-tip-of-tree): roll to r1175 (#28605) 2023-12-12 11:27:51 -08:00
cli.js chore: fix playwright-core cli (#23203) 2023-05-22 12:37:08 -07:00
index.d.ts chore: migrate to monorepo (#9421) 2021-10-11 16:52:17 +02:00
index.js chore: refactored minimum Node Major version to variable (#24188) 2023-07-18 19:57:48 +02:00
index.mjs fix: export request from index.jsm (#13158) 2022-03-30 09:35:47 -07:00
package.json chore: mark version 1.41.0-next (#28180) 2023-11-15 20:05:36 -08:00
README.md chore: drop dependency on playwright-core in all our packages (#2318) 2020-05-21 13:18:15 -07:00
ThirdPartyNotices.txt chore: use codemirror in the on-hover locator editor (#28090) 2023-11-10 22:00:28 -08:00

playwright-core

This package contains the no-browser flavor of Playwright.