Updated how errors are annotated on failures. When a task fails, the stacktrace from when that task was scheduled is appended to the rejection reason with a From:
prefix (if it is an Error object). For example:
var driver = new webdriver.Builder().forBrowser('chrome').build();
driver.get('http://www.google.com/ncr');
driver.call(function() {
driver.wait(function() {
return driver.isElementPresent(webdriver.By.id('not-there'));
}, 2000, 'element not found');
});
This code will fail an error like:
Error: element not found
Wait timed out after 2002ms
at <stack trace>
From: Task: element not found
at <stack trace>
From: Task: WebDriver.call(function)
at <stack trace>