Makes RuntimeError based on error code

We have a problem where a php script (drush) returns the correct exit code but the normal output is still considered to be an error.

This absolutely needs testing as I can't do it from here right now.
But I would like to open a discussion about it.

Code concept taken from: http://stackoverflow.com/a/10939967/1922428