Attach a custom error message if a promise fails.
If the promise succeeds, this function does nothing.
Parameters
promise: Promise<any>
The promise to wait for.
message: string
Custom message to attach to the error;
Returns Promise<any>
Example
constpage = newPage(config); awaitpage.goto('https://example.org/'); awaitcustomErrorMessage( page.waitForSelector('blink'), '<blink> element not found (BUG-123)'); awaitclosePage(page);
Attach a custom error message if a promise fails. If the promise succeeds, this function does nothing.