Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent unhandled exception from being suppressed by Promise #199

Merged
merged 1 commit into from
Jul 20, 2016

Conversation

shinnn
Copy link
Contributor

@shinnn shinnn commented Jul 19, 2016

Imagemin v5.x uses Promise, so we should have added the same safety net as sindresorhus/gulp-autoprefixer@53ad3c2.

Fixes #183.

@shinnn
Copy link
Contributor Author

shinnn commented Jul 19, 2016

@sindresorhus @kevva Hope you publish 3.0.2 after merging this PR.

@sindresorhus
Copy link
Owner

sindresorhus commented Jul 20, 2016

I'm not comfortable adding this here too without actually knowing why it resolves the issue.

Also seems like the problem is fixed in gulp 4: sindresorhus/gulp-autoprefixer#65 (comment)

@shinnn
Copy link
Contributor Author

shinnn commented Jul 20, 2016

I'm not comfortable adding this here to without actually knowing why it resolves the issue.

@sindresorhus I omitted the detailed PR description because sindresorhus/gulp-autoprefixer@53ad3c2 is your commit and I thought you know how this change fixes #183.

I'll update #199 (comment) when I have enough time and interest.

@s100
Copy link

s100 commented Jul 20, 2016

seems like the problem is fixed in gulp 4

Please spare a thought for everybody still using Gulp 3! Gulp 4 only came out... well, it's not out yet apparently.

@@ -76,7 +76,7 @@ module.exports = (plugins, opts) => {
cb(null, file);
})
.catch(err => {
cb(new gutil.PluginError('gulp-imagemin:', err, {fileName: file.path}));
setImmediate(cb, new gutil.PluginError('gulp-imagemin', err, {fileName: file.path}));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a TODO comment about removing the setImmediate when gulp 4 is targeted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// TODO: remove this setImmediate when gulp 4 is targeted

@sindresorhus sindresorhus merged commit 93534f0 into master Jul 20, 2016
@sindresorhus sindresorhus deleted the issue183 branch July 20, 2016 15:07
@kevva
Copy link
Contributor

kevva commented Jul 20, 2016

Nice work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

imagemin silently drops files
4 participants