MDL-46195 fix error handling.
MDL-46195 WebCT question import: Behat test