]> git.ipfire.org Git - thirdparty/foundation/foundation-emails.git/commitdiff
Add error checking to Premailer API call
authorGeoff Kimball <geoff@zurb.com>
Mon, 14 Dec 2015 21:34:25 +0000 (13:34 -0800)
committerGeoff Kimball <geoff@zurb.com>
Mon, 14 Dec 2015 21:34:25 +0000 (13:34 -0800)
test/gulpfile.js

index c0a8360b23a04110e6e80490606e2701d42b56dc..81143402aca33b57544895f5e5b1f06f68b4b66b 100644 (file)
@@ -59,9 +59,16 @@ gulp.task('inline', function() {
       var contents = file.contents.toString();
 
       premailer.prepare({ html: contents }, function(err, email) {
-        gutil.log('Premailer: processed ' + file.path + '.');
-        file.contents = new Buffer(email.html);
-        cb(err, file);
+        if (err) {
+          gutil.log('Premailer error:')
+          console.log(err);
+          cb()
+        }
+        else {
+          gutil.log('Premailer: processed ' + file.path + '.');
+          file.contents = new Buffer(email.html);
+          cb(null, file);
+        }
       });
     }))
     .pipe(injectTwo)