Report bazel errors rather than eating them

Change-Id: I2b767c102053f731b67e4c07f26d5af23e5169d0
diff --git a/tools/build/onos-publish-catalog b/tools/build/onos-publish-catalog
index f60304d..eba58a4 100755
--- a/tools/build/onos-publish-catalog
+++ b/tools/build/onos-publish-catalog
@@ -25,8 +25,13 @@
 export SHLVL=1
 
 function writeCatalog {
-    bazel build $* --aspects tools/build/bazel/publish_catalog.bzl%publish_catalog 2>&1 \
-        | egrep "^DEBUG: .*/publish_catalog.bzl:" | cut -d\  -f3- >> $CATALOG
+    if ! bazel build $* --aspects tools/build/bazel/publish_catalog.bzl%publish_catalog >/tmp/onos.catalog.bazel.out 2>&1; then
+        echo Bazel build of catalog failed
+        cat /tmp/onos.catalog.bazel.out
+        exit 1
+    fi
+
+    egrep "^DEBUG: .*/publish_catalog.bzl:" /tmp/onos.catalog.bazel.out | cut -d\  -f3- >> $CATALOG
 }
 
 function jars {