log stdout when we get unexpected errors
added test for non-zero exit code