clang_tidy: exit with an error code if clang-tidy fails

This also makes us print error output to stderr.

No functional change is intended.

BUG=chromium:960495
TEST=tryjob

Change-Id: Ib9f0a3cf2bc1fe67066c93ea128db27aec98935b
Reviewed-on: https://chromium-review.googlesource.com/1601197
Commit-Ready: George Burgess <gbiv@chromium.org>
Tested-by: George Burgess <gbiv@chromium.org>
Reviewed-by: Caroline Tice <cmtice@chromium.org>
diff --git a/clang_tidy/clang-tidy-parse-build-log.py b/clang_tidy/clang-tidy-parse-build-log.py
index 99234c4..e65fcc9 100755
--- a/clang_tidy/clang-tidy-parse-build-log.py
+++ b/clang_tidy/clang-tidy-parse-build-log.py
@@ -103,7 +103,7 @@
         '--url http://cs/android --separator "?l=" > %s' % warnfile)
 
   if result.returncode != 0:
-    print("Couldn't generate warnings.html")
+    print("Couldn't generate warnings.html", file=sys.stderr)
     try:
       os.remove(warnfile)
     except EnvironmentError:
@@ -112,6 +112,7 @@
       os.remove(warnfile_csv)
     except EnvironmentError:
       pass
+    return 1
 
   return 0