mjmlio / gulp-mjml

Add Gulp to your MJML workflow!
MIT License
162 stars 37 forks source link

Bug: should emit errors, not throw #7

Closed Lendar closed 7 years ago

Lendar commented 8 years ago

Usecase: don't crash gulp.watch on errors.

I suppose it should not throw, but it should emit error instead. Then error could be caught by a wrapper that will display it to the user.


Steps to reproduce:

// gulpfile.js
var gulp = require('gulp');
var mjml = require('gulp-mjml')

gulp.task('build', function () {
  gulp.src('./*.mjml')
    .pipe(mjml())
    .pipe(gulp.dest('./html'))
});

gulp.task('watch', function () {
  return gulp.watch('./*.mjml', ['build'])
})

And mjml file with syntax error:

<mjml>
balthazar commented 7 years ago

Although not the best experience I must admit, I still believe this is mostly an issue with gulp itself that they plan to fix in a future release. You might want to have a look at plumber if you don't know about it, and will serve the purpose you want to achieve.

Given the inactivity on the side of gulp though, considering to remove the throw should also be fine if the plumber solution is deemed too expensive.

$0.02

ngarnier commented 7 years ago

Hi, late reply but as explained by @Apercu, we don't think this should be handled by gulp-mjml.