Skip to content

Commit e8aa815

Browse files
committed
MDL-87521 behat: better error reporting if an adhoc task fails
1 parent 8316779 commit e8aa815

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

public/lib/tests/behat/behat_general.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,11 +1283,12 @@ public function i_run_all_adhoc_tasks() {
12831283
// If a task was successful it will be removed.
12841284
// If it failed then it will still exist.
12851285
if ($DB->record_exists('task_adhoc', ['id' => $task->get_id()])) {
1286-
// End ouptut buffering and flush the current buffer.
1286+
// End output buffering and flush the current buffer.
12871287
// This should be from just the current task.
1288+
$errordetails = ob_get_contents();
12881289
ob_end_flush();
12891290

1290-
throw new DriverException('An adhoc task failed', 0);
1291+
throw new DriverException("An adhoc task failed. mtrace() output:\n\n" . $errordetails);
12911292
}
12921293
}
12931294
ob_end_clean();

0 commit comments

Comments
 (0)