From bb4e959d2dc5847ff71bebf2c35a68917f32a67b Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Mon, 8 Jun 2020 11:41:09 -0700 Subject: [PATCH] feat(debug): add note about DEBUG=pw:api to errors (#2496) --- src/progress.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/progress.ts b/src/progress.ts index fae37a324b..da7c444042 100644 --- a/src/progress.ts +++ b/src/progress.ts @@ -104,7 +104,7 @@ export class ProgressController { return result; } catch (e) { this._aborted(); - rewriteErrorMessage(e, e.message + formatLogRecording(this._logRecording, this._apiName)); + rewriteErrorMessage(e, e.message + formatLogRecording(this._logRecording, this._apiName) + kLoggingNote); clearTimeout(timer); this._state = 'aborted'; this._logRecording = []; @@ -126,6 +126,8 @@ async function runCleanup(cleanup: () => any) { } } +const kLoggingNote = `\nNote: use DEBUG=pw:api environment variable and rerun to capture Playwright logs.`; + function formatLogRecording(log: string[], name: string): string { if (!log.length) return '';