Skip to content

Commit

Permalink
MDL-45284 behat: Replace wrongly triggered not found exception
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Apr 27, 2014
1 parent a046134 commit 560fc52
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/behat/behat_field_manager.php
Expand Up @@ -54,10 +54,15 @@ public static function get_form_field_from_label($label, RawMinkContext $context
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.
Expand Down

0 comments on commit 560fc52

Please sign in to comment.