MDL-45284 behat: Replace wrongly triggered not found exception

This commit is contained in:
David Monllao 2014-04-27 08:20:48 +07:00
parent eabcd76d4d
commit 32aea6a84f

View file

@ -54,10 +54,15 @@ class behat_field_manager {
try {
// The DOM node.
$fieldnode = $context->find_field($label);
} catch (ElementNotFoundException $e) {
} catch (ElementNotFoundException $fieldexception) {
// Looking for labels that points to filemanagers.
$fieldnode = $context->find_filemanager($label);
try {
$fieldnode = $context->find_filemanager($label);
} catch (ElementNotFoundException $filemanagerexception) {
// We want the generic 'field' exception.
throw $fieldexception;
}
}
// The behat field manager.