Skip to content

Commit 9959a4d

Browse files
authored
docs: Add note about swallowing of custom reporter errors (#37915)
1 parent 3c4194e commit 9959a4d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

docs/src/test-reporter-api/class-reporter.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ and [`method: Reporter.onError`] is called when something went wrong outside of
8787

8888
If your custom reporter does not print anything to the terminal, implement [`method: Reporter.printsToStdio`] and return `false`. This way, Playwright will use one of the standard terminal reporters in addition to your custom reporter to enhance user experience.
8989

90+
**Reporter errors**
91+
92+
Playwright will swallow any errors thrown in your custom reporter methods. If you need to detect or fail on reporter
93+
errors, you must wrap and handle them yourself.
94+
9095
**Merged report API notes**
9196

9297
When merging multiple [`blob`](../test-reporters#blob-reporter) reports via [`merge-reports`](../test-sharding#merge-reports-cli) CLI

packages/playwright/types/testReporter.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ export interface FullResult {
127127
* `false`. This way, Playwright will use one of the standard terminal reporters in addition to your custom reporter
128128
* to enhance user experience.
129129
*
130+
* **Reporter errors**
131+
*
132+
* Playwright will swallow any errors thrown in your custom reporter methods. If you need to detect or fail on
133+
* reporter errors, you must wrap and handle them yourself.
134+
*
130135
* **Merged report API notes**
131136
*
132137
* When merging multiple [`blob`](https://playwright.dev/docs/test-reporters#blob-reporter) reports via

0 commit comments

Comments
 (0)