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
In some circumstances, like "No tests found" error, reporters produce a
lot of unnecessary empty lines:
```
$ npx playwright test
Error: No tests found
$ <next command>
```
Also, `line` reporter removes the `npx playwright test` command entirely
when `onError` happens before `onBegin`.
- in docs;
- in the error message.
Terminal output:
```
$ npx playwright test foobar
Error: No tests found.
Make sure that arguments are regular expressions matching test files.
You may need to escape symbols like "$" or "*" and quote the arguments.
```
References #28551.
If request gets cancelled by the page before we fulfill it, we receive
`loadingFailed` event. In that case we'll ignore interception error if
any, otherwise the error will be propagated to the caller.
Fixes https://github.com/microsoft/playwright/issues/28490