provide more cli friendly error messages when in cli mode

Saves people from having to see the full html formatted error message when running occ or phpunit

cc @karlitschek @DeepDiver1975