MDL-40842 behat: improved exception + debugging detection