Added exception logging.

I made it like that, php-cs-fixer doesn't seem to change it either way.