Closed tolusonaike closed 5 years ago
Hi @tolusonaike.
If I understand this correctly, it should be easily solvable by introducing an error handler into your gulp pipeline, e. g.:
var gulp = require('gulp')
var mjml = require('gulp-mjml')
var mjmlEngine = require('mjml')
function handleError (err) {
console.log(err.toString());
this.emit('end');
}
gulp.task('default', function () {
return gulp.src('./test.mjml')
.pipe(mjml(mjmlEngine, {validationLevel: 'strict'}))
.on('error', handleError)
.pipe(gulp.dest('./html'))
})
Important: This particular example works only with validationLevel
set to strict
, as this setting raises a MJMLValidationError
exception.
How do you emit validation warnings with the gulp-mjml that is similar to what you get when you run
mjml -w file.mjml