Refactored duplicated reportResults function and improved logging on fai...

...lures. Thanks to hartmanng@chromium.org for pointing this out.