fix warnings when phpunit + xdebug
improve error handling