mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
feat(debug): add note about DEBUG=pw:api to errors (#2496)
This commit is contained in:
parent
4cac74f8c2
commit
bb4e959d2d
@ -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 '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user