diff --git a/build_gesso.sh b/build_gesso.sh
index 97d6f413a3220fd01d7e17e9890c0b2975620709..08d90948fce2b8803e3c500026ca383ee8025f09 100755
--- a/build_gesso.sh
+++ b/build_gesso.sh
@@ -26,6 +26,10 @@ if [[ -d gesso ]]; then
 fi
 
 git clone --branch $gesso_version https://git.uwaterloo.ca/drupal-org/gesso.git
+if [ "$?" != 0 ]; then
+  echo "Error: git clone failed"
+  exit 2;
+fi
 
 if [[ $build_option == 1 || $build_option == 3 ]]; then
 
@@ -54,6 +58,10 @@ if [[ $build_option == 1 || $build_option == 3 ]]; then
   echo "Running npm install ..."
   cd gesso
   npm install
+  if [ "$?" != 0 ]; then
+    echo "Error: npm install failed"
+    exit 2;
+  fi
   echo "Done npm install."
   echo "**************************************************************************************"
   echo ""
@@ -85,6 +93,10 @@ if [[ $build_option == 1 || $build_option == 3 ]]; then
   echo "**************************************************************************************"
   echo "Running gulp build ..."
   gulp build
+  if [ "$?" != 0 ]; then
+    echo "Error: gulp build failed"
+    exit 2;
+  fi
   cd ..
   echo "Done running gulp build."
   echo "**************************************************************************************"